How to clone a record and set its lookup field to new parent in Dynamics 365 CE

Posted by

I would like to create a copy of an existing “template” record (custom entity) and then set the lookup on the new record to a parent, in this case the account from where I start the on-demand workflow.

With the help of Demian Raschkovan’s Dynamics-365-Workflow-Tools I am able to clone a record.

And with the help of Andrew Butenko’s Ultimate Workflow Toolkit I can set the lookup field on the cloned record. First I use the workflow activity UWT: Request Builder > Set Lookup Field to set the Field Value with the Record URL of the Account and the Field Name (internal value) from the entity of the cloned record that should be updated.

Finally with the workflow activity UWT: Bulk Operations > Update Records I can update the “requested” lookup field at the cloned record that I fetch with its Guid in the FetchXml Query.

So now by starting the on-demand workflow from an account, a copy of the template record is created and linked to the account.

Easy peasy, thanks to our workflow heroes Demian and Andrew. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *