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

How to Disable Edit button on SalesTableListPage and SalesTable DetailsPage based on Customer Group ax 2012?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

On SalesTableListPage and SalesTable DetailsPage we need to disable Edit Button if Customer belongs to Cash Customer Group (Customer Group name is Cash).

For all other Customers Groups Edit button should work as normal.

How I can achieve it and code examples?

Thanks,

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Rana Anees,

    For SalesTableListPage, you can modify setButtonSell method in SalesTableListPageInteraction class. You can set the variable "allowUpdate" in this method to false if the customer group name is "Cash".

    private void setButtonSell()
    {
        SalesTableType      salesTableType = this.currentSalesTable().type();
        boolean             allowDelete = salesTableType.checkDelete(true, true);//We cannot show any dialogs from the list page as is also renders on EP.
        boolean             allowUpdate = salesTableType.checkUpdate(false, false);
        FormDataSource      salesTable_ds;
    
        // Changes for disabling edit for sales orders    
        if (CustGroup::find(this.currentSalesTable().CustGroup).Name == "Cash")
        {
            allowUpdate = false;
        }
        
        // Rest of the code
    }

    For SalesTable form, you can put this logic in the SalesTable dataource active method. you can set the datasource allowEdit to false.

    if (CustGroup::find(salesTable.CustGroup).Name == "Cash")
    {
        salesTable_ds.allowEditfalse;
    }

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans