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 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?

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

    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

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 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans