Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / help with javascript f...
Sales forum
Answered

help with javascript for a newby

Posted on by 448

Hi all,

I'm starting to write some piece in javascript for our D365s. I want to retrive data of column in parent form and set a column in form child.

As it can see in 2nd picture, in console.log the data is retrieved and are correct, but it's not charged on variable "AmbitoName" (picture 3rd).

Where I'm mistaken?

thanks for any help or suggestion.

pastedimage1672334170710v1.png

pastedimage1672334422353v2.png

pastedimage1672334530227v3.png

  • DiePic Profile Picture
    DiePic 448 on at
    RE: help with javascript for a newby

    Hi Bipin Kumar 

    thanks a lot for your precious help.

    Now it work.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: help with javascript for a newby

    Hi,

    Please check below article on the usage of async await

    www.google.com/url

  • DiePic Profile Picture
    DiePic 448 on at
    RE: help with javascript for a newby

    Hi @Guido Preite and thanks for your reply.

    The "print results" are only for my control, but I need of this variable to set another field in child page ... how must I do to have immediatley this variable?

    Can you give me more details about "you can use the async/await pattern"?

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,061 Moderator on at
    RE: help with javascript for a newby

    because the Xrm.WebApi is asynchronous, meaning that your openAlertDialog is executed before the success is completed.

    If you move the "print results" code inside the success function it will show the correct value. (or you can use the async/await pattern but in your case is probably easier to put the code inside the success function)

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans