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, ...
Answered

How to enable customized New/Delete Command Buttons on form

(0) ShareShare
ReportReport
Posted on by 63

Hi,

I have created New/Delete Command buttons under a new TabPage with 'ToolBar & List' Pattern. but that button getting disabled.

I have tried to write COC on init & updateDesign method on CustParameters form to change some standard fuctionality if any but buttons are still disabled.

UIForm.jpg

Thanks,

Harshit

I have the same question (0)
  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How to enable customized New/Delete Command Buttons on form

    Harshit Singh That's great. Please verify the answer, so it help someone in future.

  • Harshit Tyagi Profile Picture
    63 on at
    RE: How to enable customized New/Delete Command Buttons on form

    Hi Girish & Mohit,

    yes, now I got that parameters Table can have only one record, I have created new Table & added it in CustParameters form & it works.

    Thanks,

    Harshit

  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How to enable customized New/Delete Command Buttons on form

    Parameter tables have can have only one record per legal entity. You can create custom table and add it in CustParameters form. We have done the same.

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: How to enable customized New/Delete Command Buttons on form

    I think SalesParameter table cannot have more than one record. As you see you have key field as index on the table it won't allow you create more than one record in a table.

    One option will be creating a new table and add that table to form DataSource. If you create custom table you can create more than one records.

    Thanks,

    Girish S.

  • Harshit Tyagi Profile Picture
    63 on at
    RE: How to enable customized New/Delete Command Buttons on form

    Hi Girish,

    I have added my fields on Salesparameters Table which is the primary datasource of CustParameters form .& I have given Salesparameters as datasource on Tab page.

    & index on Salesparameters is key field which has ParametersKey as EDT.

    Thanks,

    Harshit

  • Harshit Tyagi Profile Picture
    63 on at
    RE: How to enable customized New/Delete Command Buttons on form

    Hi Girish,

    I cannot change directly bcz working with formextension, using form COC init but getting errros which I specified in above reply.

    Thanks,

    Harshit

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: How to enable customized New/Delete Command Buttons on form

    What is the DataSource you used for the tab page?

    In which table you have created new fields?

    What is the index on the table?

    Thanks,

    Girish S.

  • Harshit Tyagi Profile Picture
    63 on at
    RE: How to enable customized New/Delete Command Buttons on form

    Hi Mohit,

    Yes alowCreate & allowDelete Property set to no, I have wrote COC on init method, using this buttons gets enabled. But now I am able to create only one record. If I am creating 2nd record then its throwing error 'Record already exist' & if I am deleting that first record that already exist then it throwing error 'cannot delete Transaction'. 

    [ExtensionOf(formStr(CustParameters))]
    final class HSHTCustParametersForm_Extension
    {
        public void init()
        {
            next init();
    
            SalesParameters_ds.allowCreate(true);
            SalesParameters_ds.allowDelete(true);
        }
    
    }

    Thanks,

    Harshit

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: How to enable customized New/Delete Command Buttons on form

    If you set the AllowDelete and AllowCreate property to No - Add and Delete button will be disabled only.

    You need to set that property to Yes on the DataSource level.

    Thanks,

    Girish S.

  • Harshit Tyagi Profile Picture
    63 on at
    RE: How to enable customized New/Delete Command Buttons on form

    Hi Girish,

    I gave the dataSource- Salesparameters to Action Pane bcz I have added grid which have custom fields from SalesParameters DataSource.  Also I have already given Command property to New & Delete Buttons (New & DeleteRecord) & allowEdit Property set to yes only in Form Extension.

    But that AllowDelete & AllowCreate Property set to no.

    Thanks,

    Harshit

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 2,206

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans