<?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: Query to create draft for a child entity in composition in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaa-p/13876500#M4885367</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checkout the code for&amp;nbsp;fillEntities handler&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;A href="https://github.com/MertSAP/AppTemplater/blob/main/srv/apptemplater-service.js" target="_blank" rel="noopener"&gt;https://github.com/MertSAP/AppTemplater/blob/main/srv/apptemplater-service.js&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Here is a snippet you should be able to adapt:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; await this.create(ServiceAuth.drafts).entries({
            to_ServiceRole_RoleUUID: RoleUUID,
            AuthType_AuthorisationType: req.data.AuthorisationType,
            DraftAdministrativeData_DraftUUID: entity.DraftAdministrativeData_DraftUUID,
            AuthEntity_EntityUUID: entity.EntityUUID
          })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Tue, 24 Sep 2024 23:13:03 GMT</pubDate>
    <dc:creator>MattBrightman</dc:creator>
    <dc:date>2024-09-24T23:13:03Z</dc:date>
    <item>
      <title>Query to create draft for a child entity in composition</title>
      <link>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaq-p/13876397</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am using CAP(Node.js) odata V4 &amp;amp; listReport page template with fiori elements. I have two entities Lets say parent &amp;amp; child, they have a composition relation between them. The child entity table is displayed on the object page and there i have added a custom action button which opens a valuehelp dialog and there user can add multiple entries from the value valuehelp. The reason custom button was added was that it enables the user to add multiple entries in one go and he doesnt have to create it one by one using the create button. When you try to create an entry in child table using create button the call that is sent is this :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NEW Parent(ID=123&lt;/SPAN&gt;&lt;SPAN&gt;,IsActiveEntity=false)/child&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i want to replicate this call. I tried using the following but it didnt work :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;send&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;INSERT&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;into&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;`Parent(ID=&lt;/SPAN&gt;&lt;SPAN&gt;${&lt;/SPAN&gt;&lt;SPAN&gt;req&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;params&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;ID&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;,IsActiveEntity=false)/child`&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;entries&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;event&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"NEW "&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any ideas how to solve this ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Sep 2024 19:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaq-p/13876397</guid>
      <dc:creator>David21</dc:creator>
      <dc:date>2024-09-24T19:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create draft for a child entity in composition</title>
      <link>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaa-p/13876500#M4885367</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checkout the code for&amp;nbsp;fillEntities handler&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;A href="https://github.com/MertSAP/AppTemplater/blob/main/srv/apptemplater-service.js" target="_blank" rel="noopener"&gt;https://github.com/MertSAP/AppTemplater/blob/main/srv/apptemplater-service.js&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Here is a snippet you should be able to adapt:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; await this.create(ServiceAuth.drafts).entries({
            to_ServiceRole_RoleUUID: RoleUUID,
            AuthType_AuthorisationType: req.data.AuthorisationType,
            DraftAdministrativeData_DraftUUID: entity.DraftAdministrativeData_DraftUUID,
            AuthEntity_EntityUUID: entity.EntityUUID
          })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Sep 2024 23:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaa-p/13876500#M4885367</guid>
      <dc:creator>MattBrightman</dc:creator>
      <dc:date>2024-09-24T23:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Query to create draft for a child entity in composition</title>
      <link>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaa-p/13877378#M4885497</link>
      <description>Appreciate the answer, It works now.</description>
      <pubDate>Wed, 25 Sep 2024 12:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/query-to-create-draft-for-a-child-entity-in-composition/qaa-p/13877378#M4885497</guid>
      <dc:creator>David21</dc:creator>
      <dc:date>2024-09-25T12:14:11Z</dc:date>
    </item>
  </channel>
</rss>

