Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to clear a lookup field onload of record?

(0) ShareShare
ReportReport
Posted on by 26

I have a parent (Master Project) record with a subgird to show associated project records. When I click add new project, the lookup field on the project field gets automatically filled in (which is a 1:N relationship), so it is working correctly, however, now the need is to have that lookup field to be null only upon creation of record, so that the users can select a different value.  As there is already another field capturing the parent record name.  So if it is an existing record and something changes, no need to run the script to null the field. 

How can I do this?  I am guessing only with a script?

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to clear a lookup field onload of record?

    Hi USA80,

    The lookup field gets automatically filled when you click new in the sub-grid, which is by-design.

    In my example, optionset entity(Parent) and Custom(Child) have 1:N relationship, when I click new button of sub-grid view from optionset entity, optionset lookup field in custom form can be filled automatically.

    pastedimage1621907948117v1.png

    You can go settings > Customizations > Customize the system > Entities > Custom(Child entity) >N:1 relationships to find relationship between Custom an optionset entity.

    pastedimage1621909460914v4.png

    Navigate to ;'Mapping' tab, you can find the optionset field mapping, which is the reason for filling lookup field automatically.

    pastedimage1621909557755v6.png

    Now you can using business rules to clear lookup field when load page, which is one no-code way.

    Go settings > Customizations > Customize the system > Entities > Custom(Child entity) >Business rules.

    pastedimage1621908769506v2.png

    Test result:

    pastedimage1621909089167v3.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans