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 205

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, 

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    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.

  • DEEPAKNONU Profile Picture
    205 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

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

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    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
    205 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    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. 

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    Deepak,

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

  • DEEPAKNONU Profile Picture
    205 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

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

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    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
    205 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

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

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: How to disabled Delete Records submenu in File menu on Sales table List Page form

    Hi Deepak,

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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

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,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans