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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

help with javascript for a newby

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

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    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)

  • DiePic Profile Picture
    448 on at

    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"?

  • Verified answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Please check below article on the usage of async await

    www.google.com/url

  • DiePic Profile Picture
    448 on at

    Hi Bipin Kumar 

    thanks a lot for your precious help.

    Now it work.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans