Hi,
I want to execute some jscript methods available in webresource when user logs in to Dynamic CRM. Can you please guide me how to implement this?
*This post is locked for comments
There are two challenges you have:
1. Detecting when a user has logged on - Within Dynamics CRM there isn't a specific client side event that you can hook into when a user logs on. The best you can do is to store the last time a user was active and then use a 'timeout' window to decide if they are no longer logged in - you can then reset that timeout with every request.
2. Running Javascript on a non-form page. Since the user will most likely access a non-form page as their first page, you'll need to create some Javascript that is run from the ribbon as an Enable Rule on the HomePage ribbon.. EnableRule Javascript rules are run when the page is rendered.
What is your use-case? Is there a different approach you can take since your scenario doesn't really fit with the recommended extension points of Dynamics CRM.
Hope this helps,
Scott
Create a JS web resource and add it to Application Ribbon. Once you added this to application Ribbon, JS will hit on all pages including all entities, dashboard etc
In JS file you can have onload event as below to perform any operation on page load (no manual triggering point required). You can get a Xrm object here
window.onload=function(){
// perform your JS opertation here
}
Thanks,
Vijay Waghmare
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 2
UllrSki 2
SC-08081331-0 1