0

I started using the new task queue via process builder and like that I can easily point to this queue when creating a task via the field Assigned To ID. All was great until I deployed the process builder to my QA environ. Then I started to get the following error:

This error occurred when the flow tried to create records: INVALID_CROSS_REFERENCE_KEY: invalid cross reference id.

Found this same issue and surprised to find that the task queue in the deployed UAT is pointing back to the dev environ. So a manual update needs to be made every time I deploy this.

This is the link with the fix: https://developer.salesforce.com/forums/?id=9060G0000005NMzQAM

Is this critical update in any way meant to fix this static issue of queue ids not automatically updating between environs or does someone have an easy way around this?

Error "Assigned To ID: id value of incorrect type" on record assignment to queues https://help.salesforce.com/articleView?id=000353572&language=en_US&mode=1&type=1

1 Answer 1

1

The declarative way to resolve this is to have the Process Builder invoke a Flow:

  • The Flow does a query on Group to find the queue by Name
  • The Flow uses the returned Group.Id to set the Task.OwnerId

Alternatively, you can have the Process Builder set a text field on Task - Owner_Queue_Name_Hint__c and have a beforeInsert trigger on Task use that field to do the SOQL on Group to find the Group.Id to assigned to each record's OwnerId in Trigger.New

2
  • Thanks for the reply cropredy. I find it odd that rocess builder gives such an easy queue lookup based on Assigned To ID but the id remains static.
    – rickmac
    Commented Jan 9, 2021 at 2:43
  • @rickmac I had the same experience as you and developed the above workarounds about 2 years ago.
    – cropredy
    Commented Jan 9, 2021 at 3:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .