Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Enable / Disable Buttons on Forms

(0) ShareShare
ReportReport
Posted on by 576

Hi Guys,

 

I need to add a validation on movement Journals to enable and disable the post button based on some conditions.

For an example my requirement is if the Journal name is “INV” and the number of lines >1, Post button should be disabled,the button should be enabled for all other journal names

where should I apply the code and how it should be for the above case ?

Normally below should work right? But it did not..

 

In the Form InventJournal Table, In the  Methods,

Void SetPostAccess()

{

If(InventJournalTable.NameId == “Inv” && InventJournalTable.NumofLines>=1)

{

Posting.enabled(false);

}

Else

{

Posting.enabled(True);

}             

*This post is locked for comments

  • D365  beginner Profile Picture
    D365 beginner 576 on at
    RE: Enable / Disable Buttons on Forms

    I managed to create it, Thanks for your reply !

  • D365  beginner Profile Picture
    D365 beginner 576 on at
    RE: Enable / Disable Buttons on Forms

    Hi Sukrut,

    Thanks for your reply, Actually I am not sure that where to apply the code for such controls, Can you please guide me where to apply and how the code should be.

    Thanks

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Enable / Disable Buttons on Forms

    Hi!

    You should use InventJournalFormTable class instead of InventJournalTable form. Check out enableButtonsActive() method of that class.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans