Tip: Hide the button "Add Existing Record" on subgrid
#ModelDrivenApp, #MDA, #Dataverse, #PowerPlatform, #Subgrid
Last updated
#ModelDrivenApp, #MDA, #Dataverse, #PowerPlatform, #Subgrid
Last updated
Today, I'm excited to share a helpful tip on concealing the "Add Existing Record" button within a specific subgrid on a Main Form.
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. 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.
Now, we back to the Application and try to create a new Deal for Account.
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.
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 attribute.
Set Required = "Business required" for a field that is being used to show related records on Subgrid.
Yup ... I did change the attribute of the Account ID field - from "Option" to "Required".
Hopping well! [NTD]yns.asia
Okay .. Let's go ... back to the Application and check now.....
Tada The button was hidden.