Mark Complete an Activity on create through Plugin in CRM 2011

Posted on Updated on

Hi, We had a requirement to immediately close the Appointment record as completed after creating it. The initial thought was to call Set State Request on the Post Create plugin. That approach gave error. Then we tried passing statecodeand statuscode value as input parameter in Pre Plugin. That approach also didn’t work. Finally we registered a pre update plugin on appointment entity and set the values for statecode and statuscodeattributes. This worked for us. The learning is that on create of Appointment record, update message is also called. Sample Code (Pre Update)

Hope it helps.


Leave a Reply

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

You are commenting using your 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