Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Mscrm.Utilities.setReturnValue() discrepancy in UCI and legacy application

(0) ShareShare
ReportReport
Posted on by 45

Hi Community,

Mscrm.Utilities.setReturnValue() which is used to return a parameter from HTML webresource to the code from which it was called to open doesn't seems to be working any more.
It returns an error something like "Microsoft is undefined". Do we have any other way to return back the parameters or am I missing the logic somewhere.
Kindly need some help.

Thank You!

  • Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Mscrm.Utilities.setReturnValue() discrepancy in UCI and legacy application

    Hello,

    Does that help?

    An HTML web resource added to a form can’t use global objects defined by the JavaScript library loaded in the form. An HTML web resource may interact with the Xrm.Page or Xrm.Utility objects within the form by using parent.Xrm.Page or parent.Xrm.Utility, but global objects defined by form scripts won’t be accessible using the parent. You should load any libraries that an HTML web resource needs within the HTML web resource so they’re not dependent on scripts loaded in the form.

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/webpage-html-web-resources#reference-other-web-resources-from-an-html-web-resource

    Henry

  • GiridharRaju Profile Picture
    GiridharRaju 45 on at
    RE: Mscrm.Utilities.setReturnValue() discrepancy in UCI and legacy application

    Hi,

    I need to return a value from HTML webresource(a comfirm dialod box) to the code that calls the HTML webresource. How can I do that.

    Thank You!

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Mscrm.Utilities.setReturnValue() discrepancy in UCI and legacy application

    Hi,

    That is the downside of using unsupported code. It may work for sometime but will fail in future updates. I would suggest you to update your code with the supported methods. If you want to update the record, you can use web api.

    Hope this helps.

  • GiridharRaju Profile Picture
    GiridharRaju 45 on at
    Mscrm.Utilities.setReturnValue() issue in HTML webresource

    Hi Community, 

    Mscrm.Utilities.setReturnValue(returnVal) doesn't seems to be working in HTML webresource. Do we have any alternates or replacements for this.

    Thank You

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans