function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nicholas MiramsNicholas Mirams 

Clone Event adding Name Ids error

Hi,
I am trying to use process builder and a flow to clone an event and add in all the leads/contacts form the old event to the new.
The owner of the new event is a user selected from a picklist.

So far I have got the event to create but the who ids are not adding.  Can someone have a look and see where I am going wrong.

User-added image
I have first looked up the old event ID (process builder input) and then saved every field into individual variables

The looked up the table Event Who Relation using the same criteria of event id = the old event id variable I input into process builder and saved the ID and Relation ID from that table

Then I created the event record with the value of each field being the variables I saved from looking up the old event.  

Then I loop through a collection variable (Event Who relation) and assign it to a record variable (event who relation)

The decision checks if there are any ids from the loop.

Here are the assignents; -
User-added image

TaskRelationId is a record variable on the Event Who Relation table in the first assignment and they equal the relation id from the loop.  The other is the new event id

The final assignment is a collection varibale on the event who relation table and is equal to the record variable from the previous

The creation, final part of the flow is creating from the collection variable.

I get no error, how would I debug this?  do I have to assign them to the event relation table and event table and if so how.  The event clones and assigns the new owner but no who ids are showing

Thanks for any help in solving this
 
Nicholas MiramsNicholas Mirams
I now get this error This error occurred when the flow tried to create records: INVALID_CROSS_REFERENCE_KEY: invalid cross reference id