Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Firing JavaScript using custom Hosted Controls - USD

Posted on by 295

Dear all,

I am trying to fire javaScript specifically setting values in localStorage using my js at different stages in USD.

I am firing through my Custom Hosted Controls (USD Hosted Controls) and since they do not have a runscript UII Action therefore I use other CRM Active hosted controls to fire my JS using FireRequestAction and passing hosted control, action and data from my custom hosted control.

Now the issue is when sometimes my other hosted control is unavailable then due to that my other functionality takes an effect as well as my js does not run. How can I fire my JS functions or scripts in a better way so I am not dependent on other Hosted controls and can work with USD Seamlessly. I am not sure if I can use Scriptlet for this purpose,

Please help.

  • thonda Profile Picture
    thonda on at
    RE: Firing JavaScript using custom Hosted Controls - USD

    Have you tested the recommendation, if this has helped can you mark the above as answer.

  • Faran Saleem Profile Picture
    Faran Saleem 295 on at
    RE: Firing JavaScript using custom Hosted Controls - USD

    You mean to say I should create a new hosted control of type IE and place it on hidden panel. And then I can use that hosted control just to fire my runscript actions? I think I can do that. If this is what you are saying then I can try this approach.

  • Suggested answer
    thonda Profile Picture
    thonda on at
    RE: Firing JavaScript using custom Hosted Controls - USD

    Hi Farhan,

    Assuming that your hosting type is IEProcess, you may create a hosted control for this purpose place it on hidden panel, and use it for this purpose.

    If hosting type is chrome, then approach does not work, you may have to plan to copy them in context in a special variable first then plan to have a generic RunScript action call on every BrowserDocumentComplete that reads the values from this Context variable if its not equals to "null" and pushes it into local storage, once done triggers another ActionCall from script using window.open("http://uii/Crm%20Global%20Manager/CopyToContext?specialvariablename=null")

    Regards,

    Praveen T

    Microsoft Corporation

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans