<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CDS Association Value help issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-association-value-help-issue/m-p/12186219#M1980350</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I have the following basic scenario:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806995-scenario.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I am trying to create a Fiori List Report application from CDS views, that shows each Department with the corresponding Boss.&lt;/P&gt;
  &lt;P&gt;I have created the CDS views for Department and Employee and I have publish the Department view as OData service.&lt;STRONG&gt; I want to give the possibility to the user to edit the Boss of a Department having a Value help dialog with all the Employees.&lt;/STRONG&gt; This is what I managed to have in my application (providing the Value help based on &lt;EM&gt;modeled value help views&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806996-screen-department.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806997-screen-edit.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;The Value help works but my goal is to display the name of the Boss ("name" property of Employee) instead of the Boss ID ("boss_id" property of Department) while keeping the possibility to choose a new Boss from the Value help dialog. &lt;/STRONG&gt;But if I try to add the annotation for the Value help on the Boss name derived from the association, the Value help does not display any possible value.&lt;/P&gt;
  &lt;P&gt;Here it is the code of the Consumption CDS view for Department:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;...
define view ZIPDB_C_DEPARTMENT as select from ZIPDB_T_DEPARTMENT
association [0..1] to ZIPDB_EMPLOYEE as _BOSS on $projection.boss_id = _BOSS.employee_id
{
...
  @UI.hidden: true
  ZIPDB_T_DEPARTMENT.boss_id,
  
  @Consumption.valueHelp: '_BOSS'
  @UI: {
    fieldGroup: [{ qualifier: 'department_id_FG', position: 30, label: 'Boss' }],
    identification: { position: 30, importance: #HIGH },
    lineItem: [{position: 30, label: 'Boss'}]
  }
  _BOSS.name as boss,

  _BOSS
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then, If instead of &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@Consumption.valueHelp: '_BOSS'
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I use&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@Consumption.valueHelpDefinition: [{entity: { name: 'ZIPDB_EMPLOYEE', element: 'employee_id'  }}]&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then the Value help shows all the possible Employees, but when I choose one of them and click "save", a POST request with the employee_id selected is done on the "boss" property of the Department (that does not exist, so there is no update), while the correct behavior would be to update the boss_id of the Department.&lt;/P&gt;
  &lt;P&gt;It's seems a quite common scenario but I could not find the solution anywhere. Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 15:03:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-05-18T15:03:58Z</dc:date>
    <item>
      <title>CDS Association Value help issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-association-value-help-issue/m-p/12186219#M1980350</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I have the following basic scenario:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806995-scenario.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I am trying to create a Fiori List Report application from CDS views, that shows each Department with the corresponding Boss.&lt;/P&gt;
  &lt;P&gt;I have created the CDS views for Department and Employee and I have publish the Department view as OData service.&lt;STRONG&gt; I want to give the possibility to the user to edit the Boss of a Department having a Value help dialog with all the Employees.&lt;/STRONG&gt; This is what I managed to have in my application (providing the Value help based on &lt;EM&gt;modeled value help views&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806996-screen-department.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1806997-screen-edit.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;The Value help works but my goal is to display the name of the Boss ("name" property of Employee) instead of the Boss ID ("boss_id" property of Department) while keeping the possibility to choose a new Boss from the Value help dialog. &lt;/STRONG&gt;But if I try to add the annotation for the Value help on the Boss name derived from the association, the Value help does not display any possible value.&lt;/P&gt;
  &lt;P&gt;Here it is the code of the Consumption CDS view for Department:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;...
define view ZIPDB_C_DEPARTMENT as select from ZIPDB_T_DEPARTMENT
association [0..1] to ZIPDB_EMPLOYEE as _BOSS on $projection.boss_id = _BOSS.employee_id
{
...
  @UI.hidden: true
  ZIPDB_T_DEPARTMENT.boss_id,
  
  @Consumption.valueHelp: '_BOSS'
  @UI: {
    fieldGroup: [{ qualifier: 'department_id_FG', position: 30, label: 'Boss' }],
    identification: { position: 30, importance: #HIGH },
    lineItem: [{position: 30, label: 'Boss'}]
  }
  _BOSS.name as boss,

  _BOSS
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then, If instead of &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@Consumption.valueHelp: '_BOSS'
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I use&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@Consumption.valueHelpDefinition: [{entity: { name: 'ZIPDB_EMPLOYEE', element: 'employee_id'  }}]&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Then the Value help shows all the possible Employees, but when I choose one of them and click "save", a POST request with the employee_id selected is done on the "boss" property of the Department (that does not exist, so there is no update), while the correct behavior would be to update the boss_id of the Department.&lt;/P&gt;
  &lt;P&gt;It's seems a quite common scenario but I could not find the solution anywhere. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 15:03:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-association-value-help-issue/m-p/12186219#M1980350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-05-18T15:03:58Z</dc:date>
    </item>
  </channel>
</rss>

