My response was crafted with AI assistance, tailored to provide detailed and actionable guidance for your query.
To add a cookie in Dynamics 365 Sales On-Premises v8.2 and prevent the popup from showing up as per your described scenario, you will need to inject the code in a location where it runs as soon as the application loads.
Identify the Application Load Event
In Dynamics 365, custom JavaScript can be injected into forms, web resources, or even through the SiteMap customizations. However, for application-wide changes like setting a cookie at the start, you need to use the onload
event at the global level or a custom web resource that loads on all pages.
Use a Global JavaScript Web Resource
Create a JavaScript web resource that sets the cookie and ensure it’s loaded as part of your Dynamics 365 application.
setCookieOnLoad.js
javascript
Ensure the Web Resource Runs Globally
To run the web resource globally (i.e., across all forms or pages), you can add it to the Application Ribbon or the Form OnLoad Event of a globally used entity.
setCookieOnLoad.js
web resource to the form libraries.setCookieOnLoad.js
setPersistentTemplateTourCookie
Test the Implementation
persistentTemplateTourCookie
with the value HideTemplateTour
).persistentTemplateTourCookie
exists.Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156