The calculation below works for determining a late fee IF the user answers No to BOTH questions in fields "QSFiling" and "LateFeePd". How do I have the late fee show 0 if the questions are any answer other No? OR when they might change from NO to a YES
if
(dataroot.Parent.SReport.QSFiling.rawValue ="No" && dataroot.Parent.SReport.LateFeePd.rawValue ="No"){dataroot.Voucher.LateFee.rawValue=
100;}
Views
Replies
Total Likes
Hi,
you are wrong with the syntax.
= assigning a value
== is an equal operator
You have to write:
if (dataroot.Parent.SReport.QSFiling.rawValue == "No" && dataroot.Parent.SReport.LateFeePd.rawValue == "No")
{
dataroot.Voucher.LateFee.rawValue = 100;
}
This means:
IF the value from the field QSFiling No AND the value from the field LateFeePD No THEN should be the value of LateFee is 100.
Helpful?
Mandy
Views
Replies
Total Likes
Hi,
Keep below script on calculate event of the LateFee field.
if( dataroot.Parent.SReport.QSFiling.rawValue == "No" && dataroot.Parent.SReport.LateFeePd.rawValue == "No")
{
dataroot.Voucher.LateFee.rawValue=100;
}
else
{
dataroot.Voucher.LateFee.rawValue=0;
}
Thanks
Vjay
Views
Replies
Total Likes
I made that change however when I change the answer No to Yes or Yes to No it still does not recalculate, its sits with whatever I first answered in those fields.
Views
Replies
Total Likes
Not working. Does it matter that the “LateFee” field is in the Voucher subform and the two questions are in my SReport form?
Views
Replies
Total Likes
If you provide complete path of the fileds it doesnt matter.
Are you able to get LateFee = 100 ; if both the fields are "No"?
if you are getting then there might some issue with the script or the form settings.
Can you mail me the form muchukotavijay@gmail.com or you can share it here.
Thanks
Vjay
Views
Replies
Total Likes
Hi….thank you for your assistance!
Views
Replies
Total Likes
Good afternoon-
I hope you might still be available for assistance. When I run the script below in my LateFee field, it works if the two questions (QSFiling and LateFeePd) are answered NO.
However, if the user changes their initial answer from NO to YES the LateFee remains set at 100
dataroot.Fee.LateFee::calculate - (JavaScript, client)
if(dataroot.Parent.SReport.QSFiling.rawValue ="No" && dataroot.Parent.SReport.LateFeePd.rawValue ="No")
{
dataroot.Fee.LateFee.rawValue=100;
}
else
{
dataroot.Fee.LateFee.rawValue=0;
Views
Replies
Total Likes
As
nele_sonntagsaid you are still using Assignment Operators instead of using Comparison Operators.
Change your scrip to
if(dataroot.Parent.SReport.QSFiling.rawValue == "No" && dataroot.Parent.SReport.LateFeePd.rawValue == "No")
{
dataroot.Fee.LateFee.rawValue=100;
}
else
{
dataroot.Fee.LateFee.rawValue=0;
}
Thanks
Vjay
Views
Replies
Total Likes
But everytime I do it as operators instead of comparisons it doesn’t even computer if the user answers No. Whereas, if I am using the comparison operators it at least computes if answers are no.
Form attached.
Does it matter that my two question fields are droplist
Views
Replies
Total Likes
Goslinc,
please refer the below sample document.
https://workspaces.acrobat.com/?d=Xp7gmmvgWFsX6oL0G6c0mg
And what is the input are you giving."NO" or"No" or "no"?
Based on that u need to change the script.
Views
Replies
Total Likes
Its No but it doesnt work
Views
Replies
Total Likes
Can you share your file with me
Views
Replies
Total Likes
Sorry I thought I did attach it, wondering if its not getting through to you.
Views
Replies
Total Likes
Just wondering if you received my email with the form attached?
Thank you
Views
Replies
Total Likes
I didnt get your attachment.
Views
Replies
Total Likes
Goslinc,
I didnt know that you are using DropDowns for the "QSFiling" and "LateFeePd".
Can you go to binding tab of "QSFiling" and "LateFeePd" fields and uncheck "Specify Item Values:" check box and try.
QSFiling > Object > Binding .... "Specify Item Values" . Do this for both dropdowns it will work.
If it doesnt work let me know vl share the file.
Thanks
Vjay
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies