-
1. Re: Recalculate not working on LiveCycle document after new fields added
BR001 Aug 17, 2012 3:49 PM (in response to Amidwinter)Hi Andrew, One problem I find with the recalculate event is that any errors in your script don't always show up, they seem to be silently swallowed. I often put a temporary button on the form and test the script in the click event of that. Otherwise, it hard to say without seeing the form. Can you post it on Acrobat.com (or similar) and add the link to this thread? Bruce
-
2. Re: Recalculate not working on LiveCycle document after new fields added
Amidwinter Aug 20, 2012 3:39 PM (in response to BR001)Hi Bruce.
Thank you for the reply, I never though of using the temporary button totest them.I have attached a link to the current form on DropBox (.tds format in a zipfile) that I am having trouble with to this message.
Any help is truly appreciated.
Andrew
-
3. Re: Recalculate not working on LiveCycle document after new fields added
BR001 Aug 20, 2012 4:05 PM (in response to Amidwinter)Hi Andrew,
I think is just a logic problem in your form the four sub-areas have been scaled, so if they put in a B for the first sub-area that related to 72 then gets scaled by 0.1 but the total seems to still refer to the 72 value (not the 7.2).
There also seems to be a mismatch between the dropdown values and the code, B is 72 in the code but the code has 72 as a B-
Regards
Bruce
-
4. Re: Recalculate not working on LiveCycle document after new fields added
Amidwinter Aug 21, 2012 8:06 AM (in response to BR001)Hi Bruce.
Yes, the idea for our HR department was that certain areas are weighted more than others depending on the area. They are also looking to change around some of the scoring.
The problem where I run into is that once they put at least one score in each of the four subcategories they will get the final average, but if they change only one subcategory, the final average will not recalculate. They actually have to change at least one score in each of the four subcategories in order for the final average to change.
This is why I thought it may have been a recalculate issue. Before we had the weighting and scoring of each category, the final average would update with no issue.
Not sure if this helps to shed light on the issue.
Thanks,Andrew
-
5. Re: Recalculate not working on LiveCycle document after new fields added
BR001 Aug 22, 2012 7:44 PM (in response to Amidwinter)Hi Andrew,
You seem to have a circular dependency in your calculation scripts. The one in form1.#subform[0].Body.ScoreLetterGen::calculate is updating the field as form1.#subform[0].Body.ScoreLetter::calculate.
If you can add a xfa.host.messageBox(xfa.form.form1.#subform.ScoreAvg.rawValue) to the form1.#subform[0].Body.ScoreLetter::calculate code you can see that it gets called a lot of times.
You might find it easier to reference the current field using this, and you can remove the reference to the hidden field by using a variable. try something like;
var score = SUM((ScoreAvgGen*.1)+(ScoreAvgJK*.09)+(ScoreAvgJD*.36)+(ScoreAvgOSL*.45))
if ( score == null ) then
this = ""
elseif ( score >= 90 ) then
this = "A"
elseif ( score >= 85 ) then
this = "A-"
elseif ( score >= 77 ) then
this = "B+"
elseif ( score >= 75 ) then
this = "B"
elseif ( score >= 72 ) then
this = "B-"
elseif ( score >= 67 ) then
this = "C+"
elseif ( score >= 65 ) then
this = "C"
elseif ( score >= 62 ) then
this = "C-"
elseif ( score >= 57 ) then
this = "D+"
elseif ( score >= 55 ) then
this = "D"
elseif ( score < 55 ) then
this = ""
endif
Good luck
Bruce