Hi , guys ! I have question. Can I use SetState in PostUpdate plugin of entity ? May be a problems from that ? Thanks
Hi , guys ! I have question. Can I use SetState in PostUpdate plugin of entity ? May be a problems from that ? Thanks
Thank you very much !
Thanks
Hi,
You don't need to use setstate if you want to change status of the record from post update plugin. You can simply add the field in entity object and use service.update to change record status.
please see below link for more details.
docs.microsoft.com/.../entity-operations-update-delete
Hi aleenav,
Do you want to trigger the plugin on activation/deactivation of entity to update the entity field data?
If so, yes, we can use SetState message in PostOperation stage, and registration to SetStateDynamic stage is also required.
That because both messages perform the same action in CRM and as there is no typical thumb rule for which action SetState/SetStateDynamic message is fired, its better to register the plugin for both messages so that our plugin works properly.
Here is sample code for the plugin and I ran it successfully in my Dynamics 365 online environment.
http://burnignorance.com/ms-crm-app-development-tips/plugin-for-setstate-message/
In addition, here is another article about SetState message behavior:
Regards,
Clofly