Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Populate certain field when Creating a record from subgrid.

Posted on by 15

Hi All,

I have an Entity A and Entity B. Entity B has a sub grid on Entity A.

i wanted to try out a functionality in which if I am creating a new Entity B record from sub grid(clicking on Add record + button), i want certain field(Single Line of Text) to have "Not required" populated. 

whereas when i am navigating to the entity from sitemap and creating a record, the field should not be automatically populated.

Is it possible? I am trying out JavaScript for this.

Can you please suggest/help on how can I achieve this?

Thanks in advance.

Categories:
  • Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi,

    Okay.

    If you want to use main form then one option i would suggest is Hide the OOB create button and add custom button then on custom add script to open Main Form and pass custom parameter.

    Then on Form load, write one javascript function to read the queryString parameter, if parameter found then populate the field.

    In this way from subgrid you can populate the fields values.

  • RTG Profile Picture
    RTG 15 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi Pradeep,

    we are not using quick create.

    Whenever we click on add record button it will open main form.

    It is working as expected.

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi RTG,

    Quick create is not working for you?

    I mean from subgrid open quick create and When user directly create the record then CRM will open Main Form.

    Let me know if you are facing any issues with Quick Create.

  • RTG Profile Picture
    RTG 15 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi ,

    If a user creates a record For entity B directly, it will not populate the one of the field(Single line of text) present on the form.

  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 5,816 Moderator on at
    RE: Populate certain field when Creating a record from subgrid.

    Does same process will be applicable when user will try to create Entity B record directly ? If no then will have to add some exemption in JS for this scenario.

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Moderator on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi RTG,

    As per my very little knowledge, you can achieve your requirement using field mapping.

    pastedimage1673885644719v1.png

    For more details: www.linkedin.com/.../

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Populate certain field when Creating a record from subgrid.

    You mean, you will use main form only to create records?

  • RTG Profile Picture
    RTG 15 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi,

    the forms in both the ways to create a record are same.

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi,

    Please refer below link to open quick create form for subgrid.

    https://carldesouza.com/quick-create-forms/

    Thank You,
    Pradeep Rai.
    Please mark the answer as VERIFIED. If this is helpful.

  • RTG Profile Picture
    RTG 15 on at
    RE: Populate certain field when Creating a record from subgrid.

    Hi ,

    thanks for your quick answer.

    the subgrid button doesn't open the quick create form instead in both the cases main form is opened.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

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,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans