0
votes

I developed a plugin(to create a contact) and installed profiler using 'Plugin Registration Tool'.

When I create raw contact, my plugin suppose to insert that raw data into Contact. But I get an error message at 'Settings -> System Jobs' with Status Reason 'Waiting'. Error Message :

The state transition requested is not valid for the current state. Current state: 3, current status: 32, target state: 3.

I'm new to Dynamics CRM, Can anyone share thoughts on this?

1
Do you have something else going on like Workflow on create of Contact or Raw contact?Arun Vinoth - MVP

1 Answers

1
votes

The StatusCode is like a dependent picklist based on the StateCode.

For example on Opportunities, only when the StateCode is "Won" (1) can we set the StatusCode to "Won" (3). And, only when the StateCode is "Lost" (2) can we set the StatusCode to "Canceled" (4).

If you try to set the StatusCode to "Won" (3) with a StateCode of "Open" (0), you'll get the same type of error as you're seeing.

The Contact entity typically has very few State and StatusCodes, but the SystemJob entity has many (as shown here).

The fact that you're seeing a StatusCode of 32 is a strong clue that it's related to the SystemJob rather than the Contact. For the record, the StatusCode of 32 on a SystemJob indicates a StateCode of Completed with a StatusCode of Canceled.