Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

How to enable customized New/Delete Command Buttons on form

(0) ShareShare
ReportReport
Posted on by 47

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

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 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 Singh Profile Picture
    Harshit Singh 47 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
    Mohit Rampal 12,554 Super User 2024 Season 1 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
    GirishS 27,821 Super User 2024 Season 1 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 Singh Profile Picture
    Harshit Singh 47 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 Singh Profile Picture
    Harshit Singh 47 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
    GirishS 27,821 Super User 2024 Season 1 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 Singh Profile Picture
    Harshit Singh 47 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
    GirishS 27,821 Super User 2024 Season 1 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 Singh Profile Picture
    Harshit Singh 47 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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans