Dynamics CRM - Register a plug-in when the user logs in

此生再无相见时 提交于 2019-12-11 06:28:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!