web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Dynamically disable New and Delete actions on a subform based on a Boolean field in the Card page?

(2) ShareShare
ReportReport
Posted on by 229

Hi everyone,

I have created a custom Card page with a subform, and both are editable. The subform currently shows the standard New and Delete action buttons.

Here’s what I want to achieve:

  • When the Activate Boolean on the Card page is turned ON, the New and Delete buttons on the subform should be disabled or hidden.
  • When Activate is turned OFF, these buttons should be enabled or visible again.

Currently, I’ve added validation in the OnInsert(), OnModify(), and OnDelete() triggers based on the Card page’s Activate Boolean.

However, since the InsertAllowed and ModifyAllowed properties only accept true or false values (and not variables), I don’t think this can be controlled dynamically through AL code.

Is there a recommended approach or best practice to handle this kind of behavior?

Thanks in advance!

 

I have the same question (0)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,878

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,405

#3
Sumit Singh Profile Picture

Sumit Singh 2,865

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans