web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How can I disable post button of Payment Journal using Event handler

(0) ShareShare
ReportReport
Posted on by 30

I need to diable button of post button of form below

576656.Capture.PNG

I have the same question (0)
  • GirishS Profile Picture
    27,829 Moderator on at

    Hi Muhammad Zeeshan,

    Is there a any specific condition to be written to show or hide the post button?

    Also for event handler please go through the below url.

    https://wingsraamax.blogspot.com/2019/03/preeventhandler-and-posteventhandler.html

    Thanks,

    Girish S.

  • M_Zeeshan Profile Picture
    30 on at

    Yes workflow status field of selected record should be draft to hide the button

  • GirishS Profile Picture
    27,829 Moderator on at

    Hi Muhammad Zeesha,

    You need to override the form datasource "OnActivated" event handler.

    Get the form control and based on workflow status you can set visibility property.

    Please go through the below url.

    https://dynamics365axblog.wordpress.com/2019/11/19/form-datasource-onactivated-event-handler-in-d365-fo/

    Thanks,

    Girish S.

  • Suggested answer
    Martin Dráb Profile Picture
    238,601 Most Valuable Professional on at

    The first crucial information is what form it is. If you look at it, you'll see that it's LedgerJournalTable - a common form for all kinds of ledger journals.

    This form uses LedgerJournalFormTable class to control whether the Post button should be enabled. The decision is done in canLedgerJournalTableBePosted() method, therefore that's the place that you could influence. The method is wrappable, therefore you can use CoC to extend it.

    Another option would be using extending enableButtonsActive(), especially if you want to create a subtype of LedgerJournalFormTable for this kind of journal and implement its specific logic there. You couldn't use canLedgerJournalTableBePosted() in this case, because it's final.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. André Arnaud de Cal... 662 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Abhilash Warrier 280 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Martin Dráb 201 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans