smusba
5th February 2011, 10:24
Dear Sir,

I want to restrict the field (tdsfl101.quan) based on the script below.

field.tdsfl101.qana:
check.input:
max1.qty = ((tdsfl101.quan/tdsfl101.qana)*tdsfl101.qana)+(tdsfl101.quan*0.05)
min1.qty = ((tdsfl101.quan/tdsfl101.qana)*tdsfl101.qana)-(tdsfl101.quan*0.05)

if (max1.qty > tdsfl101.quan)or(min1.qty < tdsfl101.quan) then
|else
message(" The Quantiy is unacceptable for processing,MAX %3f,MIN %3f",max1.qty,min1.qty)
set.input.error("")
endif
I get the values correctly but I cannot input the accepted value in (tdsfl101.quan)field. Attached is my image for better understanding.

mark_h
6th February 2011, 02:06
Shouldn't that if be: "if tdsfl101.qana>max.qty or tdsfl101.qana<min.qty then"

In you case 6.825 is always going to be greater than 6.5.