Copy link to clipboard
Copied
I have typed in a simplified field notation to calculate (LoanAmt+SeniorLien)/(ApprValue+ApprValue2)*100 This calculation is in a field named LTV I am trying to get it to calculate a loan to value but this field is giving me an error message if the fields for LoanAmt etc don't have a number in them. Error message is "The Value Entered Does Not Match The Format of the Field [LTV]" can someone help me fix this please.
That's because if ApprValue and ApprValue2 are empty it try to divide, but you can't divide with zero, so use this as custom calculation script:
var f1 = Number(this.getField("LoanAmt").valueAsString);
var f2 = Number(this.getField("SeniorLien").valueAsString);
var f3 = Number(this.getField("ApprValue").valueAsString);
var f4 = Number(this.getField("ApprValue2").valueAsString);
if(f3||f4)
event.value = (f1+f2)/(f3+f4)*100;
else
event.value = "";
Copy link to clipboard
Copied
in the future, to find the best place to post your message, use the list here, https://community.adobe.com/
p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.
<moved from using the community>
Copy link to clipboard
Copied
I just tried that and It took me to the same place I just posted my question that you replied to
Copy link to clipboard
Copied
That's because if ApprValue and ApprValue2 are empty it try to divide, but you can't divide with zero, so use this as custom calculation script:
var f1 = Number(this.getField("LoanAmt").valueAsString);
var f2 = Number(this.getField("SeniorLien").valueAsString);
var f3 = Number(this.getField("ApprValue").valueAsString);
var f4 = Number(this.getField("ApprValue2").valueAsString);
if(f3||f4)
event.value = (f1+f2)/(f3+f4)*100;
else
event.value = "";
Copy link to clipboard
Copied
Oh My Gosh!!!! Nesa thank you so much, I have been trying to figure this out for several days working on it.