i have one query......................
i am trying to use (varient variable).iscode function as follows........
AField := TableFields.Item(2);
Cust := AField.Value; // Cust is of type varient
//MESSAGE('%1',Cust);
IF Cust.IsCode THEN
JobBudgLine.Customer := Cust;
JobBudgLine.insert;
customer field is of type 'varchar' in another database......
i am pulling that value in Navision with Cust ( varient ) variable...
i am using cust.iscode b'coz, if customer is blank, it gives error
but after using cust.iscode it doesn't go into the if statement , and doesn't insert in JobBudgLine
can anybody guess why this is happening ?
0
Comments
AField := TableFields.Item(2);
Cust := AField.Value; // Cust is of type varient
//MESSAGE('%1',Cust);
//IF Cust.IsCode THEN
//JobBudgLine.Customer := Cust;
JobBudgLine.VALIDATE(Customer, Cust); //new line here
JobBudgLine.insert;
The VALIDATE function will uppercase the variant if necessary, even if there is no code under the validate trigger. The only problem that you will get with a blank is if this field is required.
Hope it helps,
-A
this gives rise to recursive function calls and hense stack full error