Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Contains() is not working in my plugin

$
0
0

Hi

I was trying below mentioned code and it is not running the if block. My table cntains "Enddate" attribute but it is still not working. Please help me

Entity Recordtoupdate = new Entity("tpamm_membership");

Recordtoupdate.Id = ((EntityReference)entity["tpamm_membership"]).Id;

Recordtoupdate["tpamm_status"] = new OptionSetValue(239730001);

Recordtoupdate["statuscode"] = new OptionSetValue(1);

service.Update(Recordtoupdate);

if (Recordtoupdate.Attributes.Contains("tpamm_enddate"))

{
Recordtoupdate["tpamm_membershipsince"] = DateTime.Today;
Recordtoupdate["tpamm_startdate"] = DateTime.Today;

}


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images