Skip to main content

Notifications

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,811

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,

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to Disable Edit button on SalesTableListPage and SalesTable DetailsPage based on Customer Group ax 2012?

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,309 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,160 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans