PLZ help, ned to subtract 2 fields that are precalculated

New Here ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

I am new to JS and have searched and used every calculation I can to no avail. I need to

Subtract

Deposit (which is 50% of the project) from

JobDepositAmt-->(aka previous deposits)) where in some cases the

JobDepositAmt  may in fact be 0.

 

so if the job total is:

$100 and the client has already put down

$30, i need them to get to 50% down by paying

$20 more which would be the AmountDue

 

also note that Deposit is a field that already has a calculation of (JobGrandTotalAmt)*(.5)*(1000)

 

I tried simplified field as well as the custom script and it never returns. sometims it returns as 0, or it retuns with an error. Here is where i left off in the AmountDue field:

 

event.value=Number(this.getField("Deposit").value)-Number(this.getField("JobDepositAmt").value);

 

ive attached a photo for reference TIA!!

TOPICS
How to , JavaScript

Views

34

Likes

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 ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

That script look ok. Can you share the actual file?

Likes

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 ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

i included the snapshot above

Likes

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 ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

LATEST

Well, the script works fine for me. Check that other scripts don't interfere with that field.

Likes

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