Skip to main content
Participant
August 31, 2022
Question

PLZ help, ned to subtract 2 fields that are precalculated

  • August 31, 2022
  • 1 reply
  • 660 views

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!!

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
August 31, 2022

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

Participant
August 31, 2022

i included the snapshot above

Nesa Nurani
Community Expert
Community Expert
September 1, 2022

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