Notifications
Announcements
No record found.
Hello All Experts,
Can anyone help me in doing this.
*This post is locked for comments
Hi
Set null
Example:
account["customertypecode"] = null;
Refer the following:
community.dynamics.com/.../186822
Entity _entity = new Entity("Your_Name");
_entity.Id = someId;
if(_entity.Contains("Your_OptionSetValue_Attribute"){
_entity["Your_OptionSetValue_Attribute"] = null;
} else {
_entity.attributes.add("Your_OptionSetValue_Attribute", null);
}
service.update(_entity);
Hello Joman,
if the above is correct then what's wrong in below.
Entity opportunityOne = new Entity("opportunity");
opportunityOne.Id = ((Microsoft.Xrm.Sdk.EntityReference)(opportunitytypes[0].Attributes["new_opportunityid"])).Id;
opportunityOne.Attributes.Add("new_opportunitytype", null);
service.Update(opportunityOne);
is there anything wrong in above.
looks good. Is Something wrong?
1. Check whether you are getting the GUID of the record.
2. Alternatively, just use opportunityOne.Attributes["new_opportunitytype"] = null;
Hello Gopalan,
Yes you are correct ,
the guid was missing. and above code which i have put is correct.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2