I have a final totalMileage calculation at the end of a form by using... ::calculate - (FormCalc, client)
So far the summary syntax is worked as sum(Table3.Row3[31].TotalEnd - Table3.Row3[31].TotalBegin)
I'd like to add an If statement with an error message, if the sum() < Total Begin , then message show up, otherwise show the sum numbers.
I tried both JavaScript and FormCalc, no solutions, please give me some hint? Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Thanks!
I got this resolved. I chanced the event from Calculate to exit. The script works well!
form1.MileageLogSubform.Table3.Row3[0].End::exit - (JavaScript, client)
if (this.rawValue < Begin.rawValue)
{
app.alert("Error! You need to enter valid Ending");
}
Where can I find the definition about all of the JavaScript event types?
Views
Replies
Total Likes
When you used a scriptingh langauge supported by AEM Forms, what was the response?
Please post the script you used.
Views
Replies
Total Likes
I added the if statement into filed end as following. ( add error check to the end summary filed may be complicated )
Instead , I add the error check to the data entry filed. same logical , end > begin. so if end value is < begin , error message shows.
The script is at following:
form1.MileageLogSubform.Table3.Row3[0].End::calculate - (JavaScript, client)
if (this.rawValue < Begin.rawValue)
{
app.alert("Error! You need to enter valid Ending, at least > Begin mileage");
}
However, I went to Preview PDF to test, I type the number into Begin field, but when I click the end file without type any number , the error message has pop out.
And also, after the error message the End value is 1, and it can not be changed.
May I need add type value script first then check compare the value with the begin.rawValue?
Almost there. At least the error message shows up.
Would let me know how to add this.rawValue at End field first?
Views
Replies
Total Likes
Thanks!
I got this resolved. I chanced the event from Calculate to exit. The script works well!
form1.MileageLogSubform.Table3.Row3[0].End::exit - (JavaScript, client)
if (this.rawValue < Begin.rawValue)
{
app.alert("Error! You need to enter valid Ending");
}
Where can I find the definition about all of the JavaScript event types?
Views
Replies
Total Likes