Getting error while using Validate() function of No. field of Purchase line.

I have created new form of Purchase line table to capture multiple delivery schedules of same line item. While calling Validate () of No. field in Purchase Line table ite show error like below mentioned:

You cannot make any changes in the database until a transaction has been started.

Please suggest the solution for this poblem…

Thanks,

Jithin.

Can you show us the total code and where you have written?

Form - OnNewRecord(BelowxRec : Boolean)

“Line No.”:=xRec.“Line No.”+1;
“Document Type”:=xRec.“Document Type”;
“Document No.”:=xRec.“Document No.”;
Type:=xRec.Type;
“No.”:=xRec.“No.”;
VALIDATE(“No.”);

Did you set DelayedInsert property of form to yes?

if not, insert the record first then validate…

It looks to me that the situation here is: NAV is trying to insert some records in the allied tables like dimensions, etc. which are linked to the Purchase Line record which is not yet inserted. Is there a way around, not to use the VALIDATE(“No.”)?

  1. Make the DelayedInsert property of the subform “No”

  2. Remove VALIDATE(“No.”); from OnNewRecord and put it in the OnInsertRecord trigger.

Chn