How Do I Update an Object that Is in an Inactive State? (Magic xpi 4.9)
Whenever you want to change or update an object, and that object is in an Inactive or Close State, you first have to update the State.
This is not done by mapping a new State or Status to the StateCode object or statuscode field.
Instead, you do this by using the Change State operation.
This operation is used to change an entity’s state. Each entity has a state, such as Active, Inactive and Open, which can be changed with this operation.
When you use this operation, the Data Mapper has two nodes:
-
statecode, which is the Status
-
statuscode, which is the Status reason
You should provide statecodes as state strings (Active, Inactive, etc), and not as a number representing the state. Dynamics CRM only accepts statuscodes that are valid for a particular statecode, and you must make sure that you set the correct numeric values for the statuscodes. For example, you can have a Lead entity with a statecode of 0 (Open). This statecode can have a statuscode of 1 (New) or 2 (Contacted).
For a list of the statecodes and statuscodes, see: https://technet.microsoft.com/en-us/library/dn531157(v=crm.7).aspx.