I have just been given the task of converting all of our existing forms into livecycle designer and am struggling a little bit with the formula side of things. I am trying to create a form that calculates the amount of km's driven by the $ amount allocated for for the range of km's and then to give me a total, this is the formula i have created and the km's range i am trying to work with:
form1.#subform.Subform1.totalkms::calculate - (FormCalc, client)
Rates paid per kms (return)
120kms to 200km $40.00
201km to 520km $95.00
521km to 700km $150.00
701km to 1100km $223.00
the problem with this formula not working is it always tells me that there is a "syntax error near token "thentotalkms" on line 1,column 26". I have tried to rewrite it so many different ways but it just doesnt seem to work.
I have attached the document for visual representation and hopefully someone can help me as i will be needing to use these quite a bit.
Thanks in advance
if (kms.rawValue > 1100)
total = 273.00;
else if (kms.rawValue > 700)
total = 223.00;
else if (kms.rawValue > 520)
total = 150.00;
else if (kms.rawValue > 200)
total = 95.00;
else if (kms.rawValue > 119)
total = 40.00;
this.rawValue = total;
here is a modified version of your sample using FormCalc. You were close but when you reference the field that the user enters the number of Kms in then you must use the field reference only. Also writing the script in a single line will not work ...it must be seprated as I have done in my sample. You do not have to indent like I did but I do that so that it is easier to read and follow the flow for debugging.
Thank you so much for your response.
It was exactly what i needed to use.
Would all of my if formulas need to be similar to that if used in the same scenario?
I am trying to write am IF/THEN formula within livecycle that allows the sum of two fields to remain zero if left empty and not exceed 0.60. The current formula I'm using looks like this:
Any help/guidance you can provide will be helpful!