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 disabled Delete Records submenu in File menu on Sales table List Page form

(0) ShareShare
ReportReport
Posted on by 207

Hi Experts,

Hope you are doing well

I need to hide the delete reccord button from the file menu on the Sales Table List page. I already set the Allow delete properties "No" in datasource & hide toolbar property to "Yes". But still, it's enable.

pastedimage1600849416930v1.png

Kindly help me to solve this issue.

Thanks in advance, 

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

    Hi Deepak,

    Do you need this button disabled for all users or only a group of users?

  • DEEPAKNONU Profile Picture
    207 on at

    Thanks, I appriciated for your quick response. For all users i need to hide this button.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Deepak,

    In that case you can do it in the class SalesTableListPageInteraction.

    Go to method setButtonSell() and set the value for the variable "allowDelete" to false. Do an incremental CIL afterwards.

    This should disable the "Delete" button.

  • DEEPAKNONU Profile Picture
    207 on at

    Gunjan,nothing happens it's the same as before.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Deepak,

    Can you share your code? Also, did you restart the client and test?

  • DEEPAKNONU Profile Picture
    207 on at

    This is my code button sell:-

    private void setButtonSell()

    {

       SalesTableType      salesTableType = this.currentSalesTable().type();

       boolean             allowDelete = salesTableType.checkDelete(false, false);//We cannot show any dialogs from the list page as is also renders on EP.

       boolean             allowUpdate = salesTableType.checkUpdate(false, false);

       FormDataSource      salesTable_ds;

       // <GEERU>

       boolean countryRegion_RU = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]);

       if (countryRegion_RU)

       {

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonCalculateConfirmDates), canConfirmationBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonUpdateConfirmation), canConfirmationBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonProformaConfirmation), canConfirmationBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonProcessEventKanbans), canConfirmationBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonUpdateInvoice4Paym_RU), canInvoice4PaymBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonProformaInvoice4Paym_RU), canInvoice4PaymBeUpdated);

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, Generate), canConfirmationBeUpdated || canInvoice4PaymBeUpdated);

       }

       else

       {

       // </GEERU>

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, Generate), canConfirmationBeUpdated);

       // <GEERU>

       }

       // </GEERU>

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonJournalConfirmation), confirmationJournalExists && !this.currentSalesTable().returnItem());

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, QuotationConfirmationJournal), quotationJournalExists);

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EditButton),        allowUpdate);

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EditInGridButton),  allowUpdate);

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EPEditButton),      allowUpdate);

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, Delete),            allowDelete);

       salesTable_ds = this.currentSalesTable().dataSource();

       if (salesTable_ds)

       {

           salesTable_ds.allowDelete(allowDelete);

       }

       // Calculate group controls

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, MultiLnDisc), !salesTableInteractionHelper.parmInterCompanyPOInvoiceMatched());

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, EndDisc), !salesTableInteractionHelper.parmInterCompanyPOInvoiceMatched());

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, SalesCreditNote), salesTableInteractionHelper.parmCanCreditNoteBeCreated());

       this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, TieredCharges), salesTableInteractionHelper.parmButtonTieredChargesEnabled());

       // <GEERU>

       if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]))

       {

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, buttonJournalInvoice4Paym_RU), invoice4PaymJournalExists);

       }

       // </GEERU>

       if (isConfigurationkeyEnabled(configurationKeyNum(Retail)))

       {

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTableListPage, MenuItemSalesPrepayment), this.currentSalesTable().SalesStatus != SalesStatus::Invoiced);

           // disable multiline and total discount buttons for Retail orders

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTable, MultiLnDisc), !salesTableInteractionHelper.parmIsRetailOrder());

           this.listPage().actionPaneControlEnabled(formControlStr(SalesTable, EndDisc), !salesTableInteractionHelper.parmIsRetailOrder());

       }

    }

    And I restart the service also . Is there any way to hide the file full toolbar on the sales table listpage. 

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    You have to change this statement -

    boolean             allowDelete = salesTableType.checkDelete(false, false);//We cannot show any dialogs from the list page as is also renders on EP

    to this 

    boolean             allowDelete = false;

    By hide the entire toolbar, you want to hide the entire action pane?

  • DEEPAKNONU Profile Picture
    207 on at

    Thanks Gunjan, but it disables from action pane also. And I need to hide toolBar means file tab not action pane.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Deepak,

    If you made only the change that I gave you, it should disable the delete button only. If you want to disable the Sell tab, you can add another line of code here to disable the tab as well.

    Please check if there are any other changes if the action pane is getting disabled as well.

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
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans