on 05-09-2007 12:11 AM
Hi all,
I have a *.xdp template. I want to use some calculation scripts.
Scenerio:
I have 3 numerical fields:
1. Target quantity
2. Available quantity
3. Required quantity
I fill the data in # 1 with an xml. Then I generate the pdf with the above xdp and xml.
When the any user enters the Available quant i.e. # 2, I want to calculate # 3; which is:
$record.Detail[].reqdOrderQty0 = $record.Detail[].targetOrderQty0 - $record.Detail[*].availOrderQty0
I am using formCalc. On entring the Available quant and clicking somewhere else the reqd quantity should get calculated.
In which object should I put the script? and on which event?
Thanks,
Apurv
Hi Apurv,
I assume you have fields reqd, target and avail. These fields are in the same subform.
You should insert your code in calculate event of the field reqd. JavaScript (I don't use formcalc):
this.rawValue=target.rawValue-avail.rawValue;
If there will be a problem, insert following javaScript in change event of the field avail (sometimes calculate event isn't fired in complicated forms):
reqd.execCalculate();
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Apurv
You can write the code on "Exit" event of the numeric field Available Quantity.
Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.