Question

I have a custom entity Project, which is having a many to many relationship with User entity.My requirement is when an User is added to a Project he/she only can see that project.

To do that I have tried to add a custom Plugin which will share the Project record to added User, in update message of Project entity. But plugin not firing.

Is there any other way to do that? Please help me out here.

Thanks.

Was it helpful?

Solution

You need to register the step of your plugin at Associate message (and eventually Disassociate is you want to manage also when a Project record is removed from a User) not the Update one.

When a record is linked with a 1:N or N:N relationship the record doesn't get updated.

The Associate message needs to be registered against all entities (leaving empty or set to none the Primary Entity field inside Plugin Registration Tool)

If you use the Developer Toolkit you can find a tutorial to register on Associate message here:

http://zhongchenzhou.wordpress.com/2012/05/20/create-plug-in-for-message-with-no-primary-entity-associated-using-dynamics-crm-2011-developer-toolkit/

Read also this post that explains how to check the entities that triggered the plugin:

http://orwin.ca/2011/07/05/crm-2011-plugin-triggering-off-associate-message/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top