Greetings,
Would you be able to advise the following patch related function:
How I may patch a Lookup field (with field name as 'Entity1ID') in a CDS entity known as Entity#1 (a child entity) with the value from the primary field known as 'ID' (Auto Number data type) from a second CDS entity known as Entity#2 (a parent entity for one-to-many relationship)?
My goal is to fill in the forms for both Entity#1 and Entity#2 simultaneously in two separate Edit Forms but on the same screen, after user finishes entering the inputs on both forms, use the Select button to let CDS perform the following in sequential order:
(i) Submit Form2 to the parent entity (Entity #2) first --> the CDS will generate the ID (record number) in Entity#2,
(ii) use the Patch function to patch the 'ID' value of the record just created in Entity#2 with Form2.LastSubmit.'ID' to the 'Entity1ID' field in Entity#1 (child entity).
(iii) Submit Form1.
Please advise the syntax required for the patch function with an example if possible.
Thanks in advance for your help.
Regards,
Albert


Report
All responses (
Answers (