• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I am wanting help with a form that I have made with my first time using a formula in calculate tab

New Here ,
Jan 25, 2023 Jan 25, 2023

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. 

Views

498

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 25, 2023 Jan 25, 2023

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 = "";

Votes

Translate

Translate
Community Expert ,
Jan 25, 2023 Jan 25, 2023

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2023 Jan 25, 2023

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2023 Jan 25, 2023

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 = "";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2023 Jan 25, 2023

Copy link to clipboard

Copied

LATEST

Oh My Gosh!!!! Nesa thank you so much, I have been trying to figure this out for several days working on it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines