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
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
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
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
You can use the property "Testfield".
On a button(action) or trigger OnValidate or trigger OnClosePage.
eg:Testfield("fieldname");
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156