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)

Javascript code needed for auto filling textbox

(0) ShareShare
ReportReport
Posted on by

I have 6 entities. one is parent and rest are child . Parent and child is in 1:N relationship. when I put some data in the form of parent, I also want these data to be saved in similar names fields of child entity forms. Is it posible to share JavaScript code for such. Say Entity A has 2 fields sea, river; entity B,C,D,E,F also has similar names fields sea and river with many other fields. But sea and river value should come from Entity A's form. I tried so many things, but not a single was successful,please help, am too new to CRM

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    my understanding is that you would like to add the same field to 6 entities. For example, You add the field to each entity and then add it to each form; when you fill in the new field in the A entity, it will automatically also fill in in the rest 5 entities.

    If so, it may not use JS code. You could link this field by configuring a Mapping entry.

    Here are the steps:

    1. Open any form of the A entity in CRM.

    2. Go to the Customization tab and click on "Customize Entity"

    3. Navigate to 1:N Relationships on the Left Navigation Pane.

    4. Locate the A entity to the  rest 5 entities Relationship and Double Click on it.

    5. Click on "Mappings" on Left Navigation Pane.

    6. Create a new entry for your custom field.

    NOTE: You can only create mappings if the fields are the same type and length.

    Hope it helps.

    BR,

    Judy

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Suchisuchi,

    One easy way to achiev this is to write a workflow on your child entities which will update the fields from the parent entity (Assuming you have added the lookup to your parent entity on your child entity). This will work on create of you child record i.e. when you create a child record the workflow will trigger and populated teh field values from selected parent record.

    The downside of this is that if you later update the values in parent then it won't update the child records. However there are open source workflow activities available which you can use to update the child record as well.

    community.dynamics.com/.../184986

    community.dynamics.com/.../176646

    If you want to right your own code then the best option would be to write a plugin for this which will run on both child & parent and keep the values in sync.

    Hope this helps.

  • Verified answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    Hi Suchisuchi,

    Writing a workflow would be the good and OOB option in your case.

    You need to trigger that workflow on on change of River and Sea field of Entity A.

    and then you need to add 5 update steps which will update your 5 entity with those value.

    Best Regards,

    Shahbaaz

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