Mark Complete an Activity on create through Plugin in CRM 2011.

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 statecode and 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 statuscode attributes. 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.


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s