SetState
Sets the state and status of a record. The StateCode and StatusCode values can be either names (e.g., 'Won') or numeric codes (e.g., '1'), depending on the UseNameForPicklistValue connection property.
Stored Procedure-Specific Information
To execute this procedure, enter:EXEC SetState Table = 'Opportunity', Id = '00000000-0000-0000-0000-000000000001', StateCode = 'Won', StatusCode = 'Won'
Input
| Name | Type | Description |
| Table | String | The name of the table. |
| Id | String | The Id of the item to change the state for. |
| StateCode | String | The new state code for the item. Value must be a valid state code for the object in Dynamics CRM. |
| StatusCode | String | The new status code for the item. Value must be a valid status code for the object in Dynamics CRM. |
Result Set Columns
| Name | Type | Description |
| Success | String | This field is true if the object's state code and status code were updated, false otherwise. |