CRM 2013: On-Premise
We have a SSIS process that creates a Lead record. In CRM, there is a business process flow (BPF) on the Lead form. When we open the record on the Lead form, normally it's no problem. You can modify and save the record. Behind the scenes the StageID and ProcessID is automatically updated with the GUID in the database.
Recently, we ran into some issues when opening a record (that was created thru the SSIS process), an error pops up right away saying the record is a duplicate. ("A Record with these values already exists. A duplicate record cannot be created. Select one or more unique values and try again.")
I believe the error is misleading as I looked for a duplicate lead and didn't find any. I did noticed that the StageID and ProcessID is not populated like how other similar records had them. So I went down that path. I tried creating and running a workflow to set the StageID and ProcessID to the errored record but it failed out saying the same thing about it being a duplicate record. I know the workflow works because I was able to run it on another similar record (created by the SSIS process) that didn't have the pop up error when opened. It feels as though the record's StageID and ProcessID corrupted the record.
Since I have access to other processes, I tried to switch the errored record to another BPF. It switched successfully and the StageID and ProcessID finally was recorded into the database table. Thinking it would work, I then tried switching the record back to the correct BPF but it wouldn't allow me to at all. I had to write a quick update script to set the StageID and ProcessID to the correct GUID in the database. Now I can open the record without the pop up error and the right BPF showing at the top of the screen. I believe the StageID and ProcessID is the culprit as changing the BPF and manually setting the GUID back in the database seemed to have fixed the problem. I just need a CRM front-end solution.
Is this a known issue? I need to know if I needed to look for the "duplicate" issue somewhere else besides the Lead entity. Also, I need to know if there is another way to handle this without me intervening by writing a script because that is not an ideal solution in the PRODUCTION environment as I do not have access to do that sort of thing on a regular basis. This problem is happening randomly. We can create 10 leads from SSIS and 2 records could be corrupted and have this issue. I'd like to know how to get the record back in a working state on the front-end.
*Did not work:
1. Create Workflow to set the StageID and ProcessID
2. Switching the BPF and switching back to the correct one(couldn't switch back)
*Did work: But can't be solution in production environment
1. Writing an update script to set the StageID and ProcessID
Any help with this is greatly appreciated!!
Thanks!