MBS-Navision 4.0
Table 37.
New field MyField.
Onvalidate of that field, I write:
validate(quantity,myfield * 33)
the OnValidate trigger of field QUANTITY is not fired. :shock:
The value in quanitty is correct. (but all prices, ... aren't)
What this:ü
@*# :evil: ](*,)
Answers
Peter Ng
This is trivial code that suddenly doesn't work anymore?!? Or something special happens to the quantity field of T37.
The myField is a decimal.
I want to validate the entered value (in myField) in the field Quantity with a sepcific mathematical formula
You mentioned you wrote the command in the OnValidate Field. The validate command is to call OnValidate, which mean your command calling itself.
To trigger this onvalidate, it should like below: -
It should be calling outside the trigger, and not inside.
Peter Ng
Have you used the debugger to check what happens?
RIS Plus, LLC
The debugger goes through OnValidate of quantity but doesn't execute the same code as if I enter the qty directly in that field.
Example:
Table 37
MyField (decimal)
OnValidate()
// WIC adapt qty
validate(quantity,MyField * .03)
Quantity
OnValidate()
"all standard code"
On the sales order line:
If I enter 100 in quantity: price is 200 (unit price = 2) (OK)
MyField Quantity Price
100 200
if I enter 100 in MyField quantity is 3, price is still 200 should be 6 (NOK)
MyField Quantity Price
100 3 200
if I go on quantity and validate the field, price is updated to 6 (OK)!!
MyField Quantity Price
100 3 6
What's wrong? #-o
In Table 37, some functions repspond to the field you are in. This is triggerd by the CurrFieldNo
You should investigate what functions are called and somewhere add your field to some statement.
You can use code coverage or the debugger to investigate what happens.
The function UpdateUnitPrice analyze the callingField with the currentField.
The currentField in my case is MyField and NOT quantity! so he doesn't execute the unit price calc.
What a complicated case for just a price update.
:shock:
That's all folk's. Thanx for your help.
Yes, Navision is not as simple as it once was anymore
Remember the [SOLVED] thing in the subject.