问题
I would like to fire an event when the user logs in to his account on Dynamics CRM ? Such as opening a Web App beside the CRM... Is This possible ? I know that I can write plug-in that allows to augment some business process such as account creation. Any advice will be appreciated !
回答1:
CRM does not expose a plugin message for "UserLogon/UserAccess" on which you can register a plugin.
What you could do though is enable Audit User Access and register your plugin on Create of an audit entity and filter on the value in AuditAction (operation) and User Access Via Web (64) is the value you are looking for.
var entity = ((Entity)pluginExecutionContext.InputParameters["Target"]).ToEntity<Audit>();
if (entity.Operation.GetValueOrDefault() == 64)
{
//logic here
}
回答2:
I think dynamicallyCRM gives a good idea, but if you are trying to open some website, plugin is not the option; it's meant to execute server side logic.
If all end users use the same homepage when login to CRM (let's say they are asked not to change it), you can set up a custom page as the homepage, and there you are able to add scripts to do whatever you want.
来源:https://stackoverflow.com/questions/40489646/dynamics-crm-register-a-plug-in-when-the-user-logs-in