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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Pass executionContext from html to JS

(0) ShareShare
ReportReport
Posted on by 40

Hi All,

I have a HTML that open a Window through web resource. Inside that window code I have this:

"<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
<script src="ms_mydevelopment.js" type="text/javascript"></script>"
Inside the JS code, I'm not able to retrieve the executionContext. I don't need the GlobalContext. 
Can you help me?
Thanks

*This post is locked for comments

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at
    RE: Pass executionContext from html to JS

    Hi ,

    Try with this  -

    <script src="../ClientGlobalContext.js.aspx" type="text/javascript" ></script>

    check here for more info -

    docs.microsoft.com/.../getglobalcontext-clientglobalcontext.js.aspx

  • Shaminderpal Singh Profile Picture
    1,565 on at
    RE: Pass executionContext from html to JS

    Hi Guillermo Zopedro,

    Can you elaborate what you want to do with the passed context, are you going to use this to access certain fields on your parent page ?

    -Shaminder

  • Guillermo Zopedro Profile Picture
    40 on at
    RE: Pass executionContext from html to JS

    Hello Shaminder, yes of course!

    I have a "Xrm.Navigation.OpenWebResource" method that opens a new window form. Inside the new window runs some JS scripts with JQuery also. When users clicks on "Close" or "OK" button, I'm not able to close the window in the new User Interface. In current web client still works the "closeWindow(true);"

    Let me know if you need further info.

    Thanks in advance

  • Suggested answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: Pass executionContext from html to JS

    in your js:

    var context = window.parent.Xrm.Utility.getGlobalContext();

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans