Announcements
How can i apply A validation on General journal line such that if a field is left empty then request for approval cannot be sent and error msg should pop up
You can use the property "Testfield".
On a button(action) or trigger OnValidate or trigger OnClosePage.
eg:Testfield("fieldname");
Hi Pragya,
First, I recommend you to set the "ShowMandatory" property on your page to "true", so that a user will know its important..
If you want to validate the field so that the user cannot leave the page until they have entered a value, you can do so in the "OnQueryClosePage" trigger, see the following code
trigger OnQueryClosePage(CloseAction: Action): Boolean begin if Rec.FieldName = '' then begin Error('The field ''Field Name'' must be filled in.'); end; end;
However, if you only want to validate the field when a request for approval is sent, you will need to write that validation code in one of the event in your codeunit. If you can provide more information about the specific page or action, I can help you locate the appropriate event in that codeunit.
Regards
I agree with People Eater's approach. It is user interactive and restrictive at the same time. Also TESTFIELD will give a very non user friendly error, best to prefer a custom error which explains the user what went wrong rather than user coming back to you on emails
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 580 Super User 2026 Season 1
YUN ZHU 480 Super User 2026 Season 1
Grigorios Mavrogeorgis 261 Super User 2026 Season 1