0
votes

I'm encountering a strange problem. I have a workflow which triggers when an entity is created. It has the following steps.

Step 1: Update the lookup field to link to a record in the Autonumber entity.

Step 2: Set the record number field to the value of the Counter field in the Autonumber entity.

Step 3: Increment the counter field in the Autonumber entity with the value of the Increment By field in the same entity.

I use such workflows as a means of getting an Autonumber. This worked fine until I decided to import my unmanaged solution to another organisation. In this new organisation this workflow throws the following error on Step 1.

Sync workflow 'SP Electrical Autonumber' terminated with error 'systemuser With Id = 1901130da-..... Does Not Exist'

This is odd as I'm creating the entity so the workflow is set to run as the The user who made changes to the record and I've got the System Administrator profile. Further my GUID is different to the above guid and my guid exists in the database. So I'm struggling to understand where its getting this guid from. I've checked the Autonumber record in the first step using (Select * from Filteredcal_autonumber) and couldnt find the guid in the error message anywhere there too!

So where is it getting this guid and why is it that just this workflow is throwing this error. Other entities use similar workflows for their autonumbers and they seem to work fine. Any ideas? Or places to look would be much appreciated. I've investigated this myself a lot and only posting here as a last resort as I'm really out of ideas.

I have even deleted the entire workflow and recreated it again to see if this solves the issue. But it didnt and I'm still getting this error.

I've identified the guid to belong to the installer account from the previous organisation that I had imported the solution from. Not sure why the process is looking for this guid in the new organisation. Anyone?

1

1 Answers

1
votes

Ok so glad I got to the bottom of this. This is another CRM gotcha!!!

The issue wasnt with the workflow at all. Inspite of deactivating the workflow I was still getting the error. On discussing with a work colleague we concluded that one possibility where a GUID from an older organisation might have been inserted was Visual Studio. The old organisation used custom plugins and they were held in Visual Studio. When I imported the solution to a new organisation, I continued to use Visual Studio to make changes to these plugins. I continued to deploy them to the new organisation. This made Visual Studio transfer the old guids to the new organisation.

What I should have done is, in VS when you connect to a new organisation, you need to open the RegisterFile.crmregister file that you will find in the Deploy project and set any Id='[guid here]' to Id='000000-0000-0000-0000-000000000000' so that when you deploy new fresh GUIDs from the new organisation are created and stored.

To fix my problem, I unregistered the plugins, then reset the IDs in the file as above and then redeployed the plugins! Voila! Everything works now!