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 :
Microsoft Dynamics AX (Archived)

Enable/Disable "New" button based on condition

(0) ShareShare
ReportReport
Posted on by

Hi,

There is a form VendBankAccounts, where It is possible to add, delete or edit bank accounts of vendor.  I need to check if there is one created and don't allow to create multiple bank accounts, so I need to disable "new" button in BankAccountActionPane if there already is a bank account created. How could I do this? Thanks for any help.

*This post is locked for comments

I have the same question (0)
  • Yasir Shahzad Profile Picture
    1,635 on at

    dear satkus....you can disable through personalize

    regards

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    there could be many ways to do this. one way to create an index that can stop duplicate values in table with any combination of your choice.

    BUT

    do you really want to restrict system functionality or you want control on system ?

    I think taking a decision before any development can be better :)

  • Community Member Profile Picture
    on at

    I just need not to allow creating new bank account when there is one created. I thought it would be best just to disable the "New" button when there is a bank account created.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    well you can write code on active method of data source of form. as you are on D365 so you can use, pre-post event handlers

    the logic will always check if there is a record already for specific vendor, disable creation of record on  data source. such as DataSourceName_ds.allowCreate(false);

    please consider impacts of your customization as there can be cases when you need to pay to different bank accounts of same vendor.

  • Verified answer
    Ajit Profile Picture
    8,755 on at

    As Sohaib said, there are many ways to handle this. If you want every vendor to have only one bank account then you can add an index on 'VendBankAccout' table with column 'VendAccount' and choose property 'Allow Duplicates' to NO.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans