AssignRequest, SetStateRequest, SetParentSystemUserRequest and etc are deprecated in CRM 2015 Update1

Hi,

As we all know that we need to use special methods like below for different purposes

  • AssignRequest
  • SetStateRequest
  • SetParentSystemUserRequest
  • SetParentTeamRequest
  • SetParentBusinessUnitRequest
  • SetBusinessEquipmentRequest
  • SetBusinessSystemUserRequest

Some times we may miss/forget and write coding which will not fulfill the requirement or may lead to errors.

But with this Update 1, every thing can be handled in Update request.

using (var service = new OrganizationService(crmConnection))
{
    Entity account = new Entity("account");
    account["accountid"] = new Guid("0C2D5AC7-B7E4-E411-80E9-C4346BAC7DA8");
    account["name"] = "Adventure Works Inc.";
    account["creditlimit"] = new Money(100000);
    account["statecode"] = new OptionSetValue(1); //inactive
    account["statuscode"] = new OptionSetValue(2); //inactive
    account["ownerid"] = new EntityReference { LogicalName = "team", Id = new Guid("042d5707-6fe5-e411-80e5-fc15b428fa14") };
    var request = new UpdateRequest() { Target = account };
    var response = (UpdateResponse)service.Execute(request);
}
I like this update personally as it is little straight forward than the special messages.
Thank you,
Sreeni Pavalla

Published by Sreeni Pavalla

Working as a Assistant Technical Manager in Positive Edge Technologies. Having over 11 years of extensive hands-on experience in MS Dynamics CRM 4.0, 2011, 2013, 2015, 2016, Dynamics 365 with over 5 years of experience in CRM Online. You can visit my blog here https://sreenipavalla.me/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: