<?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: MDK Queryoptions using Rule does not work in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540839#M4701573</link>
    <description>&lt;P&gt;Dhanika is correct, you should not return the Entity Set name in your query options rule.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 13:51:33 GMT</pubDate>
    <dc:creator>bill_froelich</dc:creator>
    <dc:date>2022-02-23T13:51:33Z</dc:date>
    <item>
      <title>MDK Queryoptions using Rule does not work</title>
      <link>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaq-p/12540837</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;We have created an mdk project that displays a hierarchy of locations and equipments under those locations. However, we dont have a separate entity for the locations. We only have an entity for all the equipments and we just have fields to identify as to which location the equipment belongs to. Because of this, every time i read the entity, i get duplicate values for the locations.&lt;/P&gt;
  &lt;P&gt;That is why, i have created a rule to define a query option wherein the list will only get one equipment of that location. I have seen that the filter parameter that is being returned by the rule is correct, however the list still displays all the items. Would you know why the list doesn't seem to get the correct filter for this? Here's the custom rule i have written:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2023906-image.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/2023907-queryoption-device-error.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;When i added an alert displaying the output, it correctly returns the unique filter parameters.&lt;/P&gt;
  &lt;P&gt;Appreciate any inputs you may have. &lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 12:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaq-p/12540837</guid>
      <dc:creator>sopizaken</dc:creator>
      <dc:date>2022-02-23T12:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: MDK Queryoptions using Rule does not work</title>
      <link>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540838#M4701572</link>
      <description>&lt;P&gt;Hi @&lt;SPAN class="mention-scrubbed"&gt;sopizaken&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think you do not need to return the entityset name if the rule is used as a query because you already define it in the Target. Your &lt;STRONG&gt;output &lt;/STRONG&gt;variable should be as below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;let output = "$filter=";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I did a similar thing recently and what I returned was something as below and it worked totally fine.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;return "$filter=TechnicalObject eq '" + technicalObject + "'&amp;amp;$orderby=OrderNumber desc";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:44:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540838#M4701572</guid>
      <dc:creator>dhanikawick41</dc:creator>
      <dc:date>2022-02-23T13:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: MDK Queryoptions using Rule does not work</title>
      <link>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540839#M4701573</link>
      <description>&lt;P&gt;Dhanika is correct, you should not return the Entity Set name in your query options rule.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:51:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540839#M4701573</guid>
      <dc:creator>bill_froelich</dc:creator>
      <dc:date>2022-02-23T13:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: MDK Queryoptions using Rule does not work</title>
      <link>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540840#M4701574</link>
      <description>&lt;P&gt;Thanks  &lt;SPAN class="mention-scrubbed"&gt;dhanikawick41&lt;/SPAN&gt;! That solved the issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 08:27:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/mdk-queryoptions-using-rule-does-not-work/qaa-p/12540840#M4701574</guid>
      <dc:creator>sopizaken</dc:creator>
      <dc:date>2022-02-25T08:27:20Z</dc:date>
    </item>
  </channel>
</rss>

