Copy link to clipboard
Copied
I am working on a fillable order sheet with active fields of amt-1, case-price-1, with ascending numbers for each succeding amt and case-price fields, and total with total being the product of the amount x price fields. I had to use a script provided by a commenter in a couple of places where the default calculaitons would not work and it works well. I managed to get 14 lines where the total worked well with the default calculation or the script. I would update the script with the approiate fields when applying it.
Now I have hit a spot past those 14 lines in which neither the default or script calculations will work in the total field.
The script is:
var v1 = Number(this.getField("amt15").valueAsString);
var v2 = Number(this.getField("caseprice15").valueAsString);
event.value = v1 * v2;
I am facing a deadline and am now apparently dead in the water since nothing I enter seems to be working. Does anyone have any ideas?
Thsnks to those who know more than me,
Joe
Copy link to clipboard
Copied
There are four lines (records?) where the total is not working. So I skipped lines and started a new total further down the sheet that works fine with the default calculations. Not sure what that means, if anything, but one never knows.
Thanks,
Joe
Copy link to clipboard
Copied
There is no reason built in calculation wouldn't work for this, can you share your file?
Also check console for any errors.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Check the Javascript console for errors.
Copy link to clipboard
Copied
How is that done?
thanks,
Joe
Copy link to clipboard
Copied
Ctrl+J after editing the value of one of the fields.
Copy link to clipboard
Copied
In one of the fields where the total function does not work, I do the ctrl-j command and get this report on the default and script total calculations:
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
I do not know what this means or how to fix it.
Thanks,
Joe
Copy link to clipboard
Copied
Somewhere you use a field name for which no field exists. This can happens when you change field names without changing the calculations. Check the calculations in your form.
Copy link to clipboard
Copied
Thank you!!
Joe
Copy link to clipboard
Copied
Bernd, I checked my field names and made sure they matched. Also changed field names and made certain those matched. I did both with the default calculation and the script and neither would return a total in the total field, and in some cases ignored the currency format I selected. Is there a possibility of another problem?
Thanks,
Joe