Skip to main content

Notifications

Microsoft Dynamics CRM forum
Answered

Looking for help with Jscript code

Posted on by 380

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

  • Radoslavov Profile Picture
    Radoslavov 380 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

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,198 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
    Radoslavov 380 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.

  • Radoslavov Profile Picture
    Radoslavov 380 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

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 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); 

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

Dynamics 365 Community Update – Sep 16th

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…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans