web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / HIMBAP / Close custom activity entity

Close custom activity entity

Mahendar Pal Profile Picture Mahendar Pal 45,095

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);
}


Comments

*This post is locked for comments