web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 410

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

I have the same question (0)
  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at
    RE: Looking for help with Jscript code

    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
    410 on at
    RE: Looking for help with Jscript code

    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
    410 on at
    RE: Looking for help with Jscript code

    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,216 User Group Leader on at
    RE: Looking for help with Jscript code

    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
    410 on at
    RE: Looking for help with Jscript code

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 179 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 61 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans