web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Firing JavaScript using custom Hosted Controls - USD

(0) ShareShare
ReportReport
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.

I have the same question (0)
  • Suggested answer
    thonda Profile Picture
    on at

    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

  • Faran Saleem Profile Picture
    295 on at

    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.

  • thonda Profile Picture
    on at

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans