Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 123975

Blog Post: Close custom activity entity

$
0
0

MarkascompleteAre you looking to close your custom entity using SDK, then this post is for you. We can close ms crm custom activity type entity like other entities using SetStateRequest message.  You can use below code for the same

 

public void CompleteTextMessage()
{
IOrganizationService _CrmService = GetCRMService(); //a function to return ms crm service object
SetStateRequest _SetStateReq = new SetStateRequest();
//provide entity details
SetStateReq.EntityMoniker = new EntityReference(“your custom entity logical name”, new Guid(“CustomEntityID”));
// Set the State and Status OptionSet Values to completed.
SetStateReq.State = new OptionSetValue(1);
SetStateReq.Status = new OptionSetValue(2);
// call execute message by passing request object
SetStateResponse _SetStateResp = (SetStateResponse)_CrmService.Execute(SetStateReq);
}



Viewing all articles
Browse latest Browse all 123975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>