CRM 2011 Closing an Opportunity other Won. I need to be able to add a status code to the. Customer Center for Microsoft Dynamics CRM 2011. The values allowed for this field vary from object to object and cannot be customized. Only transitions defined as 'valid' in the Dynamics 365 business rules are allowed. Ferent UML behavioral diagrams (sequence, behavioral state machine, and activity). Uments, source code, and UML diagrams are examples of deliverables. Error: the difference between a computed, observed, or measured value. Activity diagrams may stand alone to visualize, specify, and document the dynamics.
Code:
//Create the request and lets say you wanna retrieve it from the “incident” entity
RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest
{
EntityLogicalName = “incident”,
LogicalName = “statuscode”,
RetrieveAsIfPublished = true
};
{
EntityLogicalName = “incident”,
LogicalName = “statuscode”,
RetrieveAsIfPublished = true
};
//Get the response
RetrieveAttributeResponse attributeResponse = (RetrieveAttributeResponse)_serviceproxy.Execute(attributeRequest);
RetrieveAttributeResponse attributeResponse = (RetrieveAttributeResponse)_serviceproxy.Execute(attributeRequest);
// Cast the response to attribute meta data
AttributeMetadata attrMetadata = (AttributeMetadata)attributeResponse.AttributeMetadata;
AttributeMetadata attrMetadata = (AttributeMetadata)attributeResponse.AttributeMetadata;
// Cast AttributeMetadata to StatusAttributeMetadata
StatusAttributeMetadata statusMetadata = (StatusAttributeMetadata)attrMetadata;
StatusAttributeMetadata statusMetadata = (StatusAttributeMetadata)attrMetadata;
//Create Dictionnary
var dict = new Dictionary<int?, string>();
var dict = new Dictionary<int?, string>();
//Loop through each option and get value & label
foreach (OptionMetadata optionMeta in statusMetadata.OptionSet.Options)
{
dict.Add(optionMeta.Value, optionMeta.Label.UserLocalizedLabel.Label);
foreach (OptionMetadata optionMeta in statusMetadata.OptionSet.Options)
{
dict.Add(optionMeta.Value, optionMeta.Label.UserLocalizedLabel.Label);
//To get the mapping state code
int stateOptionValue = (int)((StatusOptionMetadata)optionMeta).State;
}
Note: you can check how to create Service Proxy at the following link
https://crmprof.wordpress.com/2013/03/13/creating-organization-service-proxy-in-microsoft-dynamics-crm-2011/
https://crmprof.wordpress.com/2013/03/13/creating-organization-service-proxy-in-microsoft-dynamics-crm-2011/
![Microsoft Crm 2011 State Code And Status Code Values Meaning In Uml Microsoft Crm 2011 State Code And Status Code Values Meaning In Uml](/uploads/1/2/6/2/126244262/752550693.jpg)
Advertisements