c# - Dynamics CRM 2016 Plugin triggered when user role assignments are changed -
is possible in dynamics crm 2016 have plugin fires when user's role assignments changed?
if so, message , entity register plugin on?
you need register plugin associate message,primary , secondary entity none.
in plugin, need check context.messagename ("associate" or "disassociate") , context.inputparameters[“relationship”] (we looking "systemuserroles_association")
code check conditions that
//all usual plugin stuff here if (context.inputparameters.contains("relationship")) { relationshipname = context.inputparameters["relationship"].tostring(); } // check “relationship name” intended 1 if (relationshipname != "systemuserroles_association") { return; } if (context.messagename == "associate") { //logic when role added } if (context.messagename == "disassociate") { //logic when role removed } else { //not interested }
i haven't compiled code, should give idea how proceed.
Comments
Post a Comment