Skip to main content

Notifications

Announcements

No record found.

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 2

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
    Community Member Microsoft Employee 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans