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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

JScript to fill state field on Contact from Account

(0) ShareShare
ReportReport
Posted on by

What script would I write that pulls the State value at the Account level in to the State field on the Contact form when creating said contact?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi Stanton,

     have a look here:

    community.dynamics.com/.../107172

    There is a good example from Jason Lattimer there. Might not be exactly the same field, but you'll see how it's done.

    PS. You might also use relationship mappings, but it will only work when adding a new contact to a subgrid on the account form (not when selecting account lookup directly on the contact form).

  • Community Member Profile Picture
    on at

    Thanks Alex, this needs to run on creation though and not OnChange. As I understand it there is no JScript function for OnCreate.

    You're correct in your PS, this only needs to happen when a contact is created from the "subgrid", contacts related to the account. Are you suggesting I create a workflow to do this? If so, my only hesitation is that the workflow will not run until after the contact is created, I want users to be able to see the address fields filled out before they create the contact.

    Thanks for taking the time to read this.

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi Stanton,

     have you looked into the mappings?

     crm.fullscope.com/save-time-entering-data-into-crm-by-mapping-fields-between-records

     It's probably what you need in your scenario.

    To answer your other questions:

    - If it's CRM 2011, then you are correct about those issues with the wrofklow. In the later version of CRM you can have real-time workflows

    - As for the OnCreate, there is "OnSave" event handler you can define for a form and,

    then, you can use a javascript there. Still, have a look at the mappings..

  • Community Member Profile Picture
    on at

    That did it, I was not aware of that customization option. Thanks Alex!

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans