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 :
Finance | Project Operations, Human Resources, ...
Unanswered

I need to disable the add,addlines,addproducts ,remove button for a certain condition for the salesTable form.But my code is not working

(0) ShareShare
ReportReport
Posted on by 19

6866.pastedimage1670827287251v1.png

I have the same question (0)
  • Martin Dráb Profile Picture
    236,552 Most Valuable Professional on at
    RE: I need to disable the add,addlines,addproducts ,remove button for a certain condition for the salesTable form.But my code is not working

    Moved from Dynamics 365 General Forum, because the code looks like X++.

  • Martin Dráb Profile Picture
    236,552 Most Valuable Professional on at
    RE: I need to disable the add,addlines,addproducts ,remove button for a certain condition for the salesTable form.But my code is not working

    If your goal is preventing users from creating and deleting lines, your approach is wrong, because users don't have to use these buttons. Instead, you should set the data source to disallow creates and deletes. For example:

    SalesLine_ds.allowDelete(false);

    Also note that sometimes is better to keep the option enabled and stop the process in validation (e.g. valiidateDelete()), because then you can tell us why it's not allowed. If they just see a disabled button, they may have no idea why.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,841

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 836 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 531 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans