> For the complete documentation index, see [llms.txt](https://dyns.ntd.asia/power-dynamics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dyns.ntd.asia/power-dynamics/power-platform/model-driven-app/tip-hide-the-button-add-existing-record-on-subgrid.md).

# Tip: Hide the button "Add Existing Record" on subgrid

\#ModelDrivenApp, #MDA, #Dataverse, #PowerPlatform, #Subgrid

&#x20;   Today, I'm excited to share a helpful tip on concealing the "Add Existing Record" button within a specific subgrid on a Main Form.

&#x20;   I've established a one-to-many relationship between the "**Account**" entity and the "**Deal**" entity. Within the "**Deal**" entity, I've created a lookup field called "*Account (ntd\_account\_id)*," linking it to the "**Account**" entity. \
&#x20;   Following that setup, I proceeded by including the "**Deals**" **subgrid** onto the **main form** of the "**Account**" entity. *On the subgrid, I select the option "Show related record" via the field Account ID relationship.*

<figure><img src="https://4233060750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjhtQupP7ACZVtv3cCNCr%2Fuploads%2FS68bzSKVMxexYvLzg1Ks%2Fimage.png?alt=media&amp;token=65196ff4-7b6c-4e78-ab38-7086dc45fc2d" alt=""><figcaption><p>Customize entity: Deal &#x26; Account</p></figcaption></figure>

Now, we back to the Application and try to create a new Deal for Account.&#x20;

<figure><img src="https://4233060750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjhtQupP7ACZVtv3cCNCr%2Fuploads%2FfyrU77SNxU5TQCYhXbUI%2Fimage.png?alt=media&amp;token=b17a0f37-e0c4-4a0a-9410-0a43f288ab22" alt=""><figcaption><p>"Add existing Deal" button on subgrid</p></figcaption></figure>

When the user creates new Deals for this Account, users encounter the "Add existing Deal" button, which often leads to confusion due to its presence.&#x20;

At this time, previously, I will ask the Dev Team to hide this button immediately by using code. \
However, now, I discovered that the reason behind its visibility is **the Account ID field being set to an Option** attribut&#x65;**.**

<figure><img src="https://4233060750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjhtQupP7ACZVtv3cCNCr%2Fuploads%2FszzEVxUlC9UwACFGKH30%2Fimage.png?alt=media&amp;token=2e904525-77dc-4efb-9a7f-69d18398c4f1" alt=""><figcaption><p>Change the attribute of field: Option to Required</p></figcaption></figure>

{% hint style="info" %}
Set **Required = "Business required"** for a field that is being used to show related records on Subgrid.
{% endhint %}

Yup ... I did change the attribute of the **Account ID field - from "Option" to "Required".**&#x20;

Okay .. Let's go ... back to the Application and check now\..... :relaxed:

<figure><img src="https://4233060750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjhtQupP7ACZVtv3cCNCr%2Fuploads%2F2fwrUGtRUwGR4MLi43uy%2Fimage.png?alt=media&amp;token=340add82-3a46-48fd-bca0-1c92feff2065" alt=""><figcaption><p>The "Add existing Deal" hidden</p></figcaption></figure>

Tada :tada: The button was hidden.&#x20;

Hopping well!\
**\[NTD]yns.asia**
