web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

StageID and ProcessID on Lead entity

(0) ShareShare
ReportReport
Posted on by

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!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: StageID and ProcessID on Lead entity

    Hello,

    we are having the same issue after we upgraded CRM, ProcessId is not being created in the DB when a Lead record is open and because of that the BPF to convert a Lead to a Contact is not being displayed. Have you end up figuring out what happened?

    Thank you!

    Mariella

  • Community Member Profile Picture
    on at
    RE: StageID and ProcessID on Lead entity

    - No Lead doesn't has duplicate detection turned on.

    - The StageID and ProcessID is automatically saved in the DB table, once the Lead record is opened.  It's not being set by me/code.  I'm not sure how CRM gets and sets the two values.  I just know that this only happens randomly, not all similar records act this way.

    -There are scripts and plugin code that does some things but nothing to do with StageID and ProcessID, and like mentioned before, it is randomly happening.

    - No

    - No -- I don't think the SSIS job is doing it.  SSIS creates the Lead record.  You do see it in the Lead entity in CRM.  It's when you open the record on the CRM front-end is when this is occurring.

  • Vassil Profile Picture
    on at
    RE: StageID and ProcessID on Lead entity

    Hi LTr,

    There is another field which you might need to set when you are creating the record related to a BPF - "traversedpath". This field contains a comma-seperated string with all the stages that the process has gone through.

    So in case you want to put the Lead in your first stage for the process, you need something like: lead["traversedpath"] = processStageId

  • Community Member Profile Picture
    on at
    RE: StageID and ProcessID on Lead entity

    Hi LTr,

    I have not come across this exact issue but I hope I can help by making a couple of suggestions about where to look for the cause.

    Please excuse me if these are obvious or right off track.

    • Do you have any duplicate detection rules for Leads that are not related to the StageID and ProcessID fields.
    • Are StageID and ProcessID set to static values on creation? Or are they incremented by a process that queries a stored incremental value. If the latter is the case, could it be that the creation process is running a second time before the stored value is incremented?
    • Do you have any scripts running on the lead form that could be changing data in the back of the form but not refreshing the visible fields.
    • Have you run a trace to see if there is more specific information (field names or values) for the duplicate problem.
    • Can you modify the SSIS job to log the records somehow, which would allow you to compare them to the records created in CRM.

    I hope these suggestions help.

    Please let me know if they do.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans