<?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>Question Re: CAP annotation @Common.valuelistwithfixedvalues with... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaa-p/13619277#M4819784</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/139138"&gt;@abranjan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I could'nt find the solution through annotations, but via different route.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will have to cache the selected value from the drop down locally in the runtime&amp;nbsp; and use it as filter in the following manner.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;srv.on('READ','Myentity',async req=&amp;gt;{
      

    if(req.query.SELECT !== undefined){
      const condtionLiteral =`DropDownFieldName='SelectedDropDownFieldValue'`

     //instantiate the cxn parser object
      const parser= cds.parse;
      // parse cxn : resultant =&amp;gt;   {xpr:[ {ref:['DropDownFieldName']}, '=', {val:'SelectedDropDownFieldValue'} ]}
      const cxnObject = parser.expr(condtionLiteral);
      const cxnArray = [...cxnObject.xpr];
      req.query.SELECT.where = cxnArray;
    }

    const data = await srv.run(req.query);
    return data 
})&lt;/LI-CODE&gt;&lt;P&gt;Please also have a look at this documentation of CXN -&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://cap.cloud.sap/docs/cds/cxn#operators" target="_self" rel="nofollow noopener noreferrer"&gt;CXN-Expression Notation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;.Let me know if this works for you.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramaniyam N&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2024 12:31:27 GMT</pubDate>
    <dc:creator>Subramaniyam</dc:creator>
    <dc:date>2024-02-26T12:31:27Z</dc:date>
    <item>
      <title>CAP annotation @Common.valuelistwithfixedvalues with Flexible Programming Model not working</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaq-p/12806282</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I am creating a CAP application with Filter Bar and Smart table control using Flexible programming model and cds annotations.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt;: Based on the selection of one drop down value I want to restrict few values of another drop down from Filter Bar. (I want if-else sort of conditional flexibility on the value selection from 1st drop down -- so that other drop down values can be manipulated) -- Using &lt;STRONG&gt;Annotations&lt;BR /&gt;&lt;BR /&gt;Flexible Programming Model: &lt;/STRONG&gt;I have tried out FPM with CAP cds annotations. I specifically wanted this below feature to work out for me:&lt;/P&gt;
  &lt;P&gt;4) Context-Dependent Value Help - &lt;A href="https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/advancedFeatures/guidanceValueHelp" target="test_blank"&gt;https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/advancedFeatures/guidanceValueHelp&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;but when I put context and conditions like SAP has maintained here in above guide. I am not able to make it work.&lt;BR /&gt;&lt;BR /&gt;Is there any suggested way to approach this??&lt;BR /&gt;Or if anyone knows how to properly use context and conditions with CAP cds annotations?&lt;BR /&gt;&lt;BR /&gt;It would be a great help!!&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!!&lt;BR /&gt;Abhijeet&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 12:43:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaq-p/12806282</guid>
      <dc:creator>abranjan</dc:creator>
      <dc:date>2023-08-31T12:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: CAP annotation @Common.valuelistwithfixedvalues with Flexible Programming Model not working</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaa-p/12806283#M4808766</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;abhishek.ranjan5&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Could you please share what you have done so far w.r.t. Context-Dependent Value Help?&lt;/P&gt;&lt;P&gt;It would help us in order to determine what is wrong with the project. &lt;/P&gt;&lt;P&gt;If you could also share a prototype on github, maybe we could even propose changes on the code so it works as you expect.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Ivan&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 18:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaa-p/12806283#M4808766</guid>
      <dc:creator>Ivan-Mirisola</dc:creator>
      <dc:date>2023-09-01T18:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: CAP annotation @Common.valuelistwithfixedvalues with...</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaa-p/13619277#M4819784</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/139138"&gt;@abranjan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I could'nt find the solution through annotations, but via different route.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will have to cache the selected value from the drop down locally in the runtime&amp;nbsp; and use it as filter in the following manner.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;srv.on('READ','Myentity',async req=&amp;gt;{
      

    if(req.query.SELECT !== undefined){
      const condtionLiteral =`DropDownFieldName='SelectedDropDownFieldValue'`

     //instantiate the cxn parser object
      const parser= cds.parse;
      // parse cxn : resultant =&amp;gt;   {xpr:[ {ref:['DropDownFieldName']}, '=', {val:'SelectedDropDownFieldValue'} ]}
      const cxnObject = parser.expr(condtionLiteral);
      const cxnArray = [...cxnObject.xpr];
      req.query.SELECT.where = cxnArray;
    }

    const data = await srv.run(req.query);
    return data 
})&lt;/LI-CODE&gt;&lt;P&gt;Please also have a look at this documentation of CXN -&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://cap.cloud.sap/docs/cds/cxn#operators" target="_self" rel="nofollow noopener noreferrer"&gt;CXN-Expression Notation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;.Let me know if this works for you.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramaniyam N&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 12:31:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-annotation-common-valuelistwithfixedvalues-with-flexible-programming/qaa-p/13619277#M4819784</guid>
      <dc:creator>Subramaniyam</dc:creator>
      <dc:date>2024-02-26T12:31:27Z</dc:date>
    </item>
  </channel>
</rss>

