error in subform purchase lines

I made a copy of form 50 and form 54, to 50901 and 50902

When I create a ney line in SubForm 50902 I Get one error message:

"You must specify Document No. in Purchase Line Document Type = ‘Order’ Document Type = ‘’, line No. = ‘0’ "

Why this error???

I did the same but i didnt get any error message…

check with debugger,…

First compile both forms(50901,50902) and check whether u r getting any errors or not.

It is not the proper way to enter the data directly into the Subform(50902) because it is linked to the 50901.Finally we get that error which u mentioned.

Before that I guess you have entered No. in Header?

As per base version it should insert No. when you click somewhere else in form…

But I inser data correctly. In first I inser Purchase Header data, and the when I Inser the first line in Purchase Line, on insert type field I get the error message.

With Debuger i Get the error on Table 39 Linha Compra\GetPurchHeader()

GetPurchHeader()
TESTFIELD(“Document No.”);
IF (“Document Type” <> PurchHeader.“Document Type”) OR (“Document No.” <> PurchHeader.“No.”) THEN BEGIN
PurchHeader.GET(“Document Type”,“Document No.”);
IF PurchHeader.“Currency Code” = ‘’ THEN
Currency.InitRoundingPrecision
ELSE BEGIN
PurchHeader.TESTFIELD(“Currency Factor”);
Currency.GET(PurchHeader.“Currency Code”);
Currency.TESTFIELD(“Amount Rounding Precision”);
END;
END;

I don’s understand Why. These forms where a coy from the Form standard ones.

Thanks

Is it working fine in base forms?

what is the table relation in Document No of Purchase Line?

and also check the SubFormLink in main form

Yes, it is working fine in base Forms

The table relation is:

“Purchase Header”.No. WHERE (Document Type=FIELD(Document Type))

Where can I Check the SubForm link in main form??

You have to select the subform in form50901 and properties,.

Mohana Thanks, the SubForLink property in <SubForm was wrong, after correct, the problem desapear

thanks a lot

Welcome [:)]