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

Looking for help with Jscript code

(0) ShareShare
ReportReport
Posted on by 422

Hi All, i have this Jscipt web resource which I'm using on a lookup filed inside a Contact.

When an Account is selected, it gets some values from fields inside the Account and pastes them into the same fields into the Contact form, however, it pastes only the phone number, all other fields remain empty. Any help if something is wrong with the code is appreciated.

  1.             Xrm.Page.getAttribute(new_parentaccount).setValue(object);  

here is a picture of the fields and the logical names as per the script 

6557.PNG

2450.PNG

25743.PNG

regards

Kiril

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at

    Hi Kiril,

    Field name new_parentaccount is not within quotes.

    Change it from Xrm.Page.getAttribute(new_parentaccount).setValue(object); to Xrm.Page.getAttribute("new_parentaccount").setValue(object); 

  • Radoslavov Profile Picture
    422 on at

    Hi Charan,

    I've corrected it, but still verification required, activation date, and parent account, and the shipping method are not taken from the parentaccountid.

    regards

    Kiril

  • Radoslavov Profile Picture
    422 on at

    It seems that it required clearing the browser cache after publishing the new changes, it didn't work with regular page reload, thanks Charan.

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi,

    I'm glad you were able to implement your Js code. However, I notice that you are using a code that is deprecated..

    Please refer to this blog to update your code with the new Client API: itsfascinating.com/.../

  • Radoslavov Profile Picture
    422 on at

    Hey, thanks Mehdi,

    for sure I will update the code and post the new version in an article for future references and refer to the provided article.

    Great catch and thanks :)

    Regards

    Kiril

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 87 Most Valuable Professional

#2
11manish Profile Picture

11manish 69 Super User 2026 Season 2

#3
Syed Aqib Raza Profile Picture

Syed Aqib Raza 48

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans