Hey!
I am trying to validate if all necessary fields are entered before an PDF is created and attached.
How would I go on to do that?
thanks a lot and greetings
Hey!
I am trying to validate if all necessary fields are entered before an PDF is created and attached.
How would I go on to do that?
thanks a lot and greetings
Hi - I think you are combining two different things or I've misunderstood. But I'll try:
1. If you want the PDF to not be printed from Sales Quote if certain fields are not having values, use the Report triggers to write your errors and not page triggers. You can use relevant table's OnAfterGetRecord as you'll get all values here straightaway
2. You can alternatively make use of a Subscriber which will be called as soon as the PRINT button is pressed from the page. Once event named "OnBeforeActionEvent" is called via your subscriber, you can do TESTFIELD of various fields here in this snippet only. Only when there are no errors from these TESTFIELDS, will your report request page come up. Sample code screenshot below
Do verify the answer by clicking "YES" for "Did this answer your question" - if you feel it helped you in anyway, so that others can get benefit out of it too. Thankyou very much for taking out time to read
Thank you for your answer Inge!
Interesting, I see your reasoning as this being a general good approach.
On a more specific note: What kind of scenarios could there be, where I would generate a Sales Quote outside of the Sales Quote PDF functions?
Either you should add an action to your page extension and do you testfields in that action or you should the testfield as part of the report that create your code.
To do it in a page trigger is not so smart in my eyes.
If you use the release function before you create the pdf you could also subscribe to the OnBeforeRelease event.
Personally i think the best way is to build the testfields into the report that is used for creating the PDF. In that way you make sure the testfields are executed no matter from where you start your report.
Hello Inge,
my mistake, english is not my first language.
Exaclty!
What I am trying to do: On Page-Extension Sales Quote I am trying to find a trigger on PDF creation that lets me perform Testfield on the different fields
Thank you!
What do you mean by set this up?
There is no setup that will allow you to configure this in the standard system.
So what you will have to do is to customize a report that check if all necessary fields are there before it allows the report to be printed.
Hello Aman
Thanks for you answer. I am looking to set this up, so I am more looking towards technical ideas
Thanks!
Hello
You have to make the field mandatory at Document Header level or Line level for those who were add at PDF.
Please ask your developer to do so.
Please Verify my answer if you found relevant so it will help to others member also.
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156