c# - Error in Saving of Regarding Attribute (Lead_PhoneCall Activity) from CRM Portal (2011)? -
i trying save guid of lead in regarding field of phonecall activity, gives error - "regardingobjectid" only. [on premise]
please help!
in new_phonecall.cs page :
phonecall_save.regardingobjectid = guid.parse(hdnfld_regarding.value); //(hdnfld_regarding hiddenfield in m passing guid, have taken along textbox)
in appcode/crmdmlibrary.cs :
public class phoneentity { public guid regardingobjectid; } public bool savenewphonecall() { try { iorganizationservice context = crmdmlibrary.getcrmservice(url, domainname, username, password); entity phone = new entity("phonecall"); phone["regardingobjectid"] = new entityreference("regardingobject", regardingobjectid); guid phoneid = context.create(phone); return true; } catch (exception ex) { httpcontext.current.response.write(ex.message); httpcontext.current.response.end(); return false; } }
passing regardingobject entityreference wrong.you should pass lead entityreference
phone.attributes["regardingobjectid"] = new entityreference("lead", regardingobjectid);
also check lead id coming from
Comments
Post a Comment