Skip to main content

Notifications

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

HTML open on button click

Posted on by 20
Good afternoon!

I started studying development for dynamics a short time ago and I faced a challenge: I would like that, by clicking on a customized button, an opportunity page would be opened (that is, an html when clicking on the button). On this page there will be a lookup for opportunities and I need to get the return (that is, the chosen record). How could I start doing this?
  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: HTML open on button click

    Hello,

    That answers a lot. This namespace was introduced as a part of 9.0 release. Check following post that should help you with 8.2 - www.inogic.com/.../

  • RE: HTML open on button click

    Version 1612 (8.2.14.10)

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: HTML open on button click

    What version of CE do you use?

  • RE: HTML open on button click

    Yes, I am doing it just this way.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: HTML open on button click

    Ok. Now the next question - in what way did you insert the code into onload of the opportunity page? Can you confirm you did it in this way - reenhanced.com/.../

  • RE: HTML open on button click

    I use a translator, so I apologize for the translation errors. I understand that I am confused for those who are reading. I'll try again: I inserted this code in the onload of the opportunity page, without being linked to a button, just to test if it opened the dialog.

    However, the error I mentioned above has occurred.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: HTML open on button click

    Can you please explain in detail what do you mean with "I inserted the following code snippet into the page's onload"

  • RE: HTML open on button click

    I inserted the following code snippet into the page's onload:

    let lookupOptions = {

    defaultEntityType: "account",

    entityType: ["account"],

    allowMutiSelect: False,

    };

    Xrm.Utility.lookupObjects (lookupOptions) .then(alert ("sucess")).fail(alert("fail"));

    When loading the page, the following error is displayed: "TypeError: Xrm.Utility.lookupObjects is not a function at Object.onload."

    Any idea what might be going on?

  • RE: HTML open on button click

    Andre, thank you very much for the reply. I will try to do what you suggested and I will return here soon.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: HTML open on button click

    Hello,

    I can be wrong but there is no need in HTML to be opened. You can use Xrm.Utility.lookupObjects to open the lookup dialog, provide the value and return the result to the calling side - docs.microsoft.com/.../lookupobjects

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans