Can you please explain how to pass Some data to Main form to sub Form

hai Friends

I am New To Navision.

In Sales Invoice (Form id 43) forum when ever the user selecting a new item Id from the Sales invoice sub form (Form id 47) the Document number , Document Type,Sell to customer all these data are automatically pick up Values from sales header (Table Id 36 ) to sales line table (Table Id 37) how is it possible can anyone please explain these in essay way…?[H] Please help me … [8-)][8-)][8-)]

otherwise Can you please explain how to pass Some data to Main form to sub Form

Thanks In advance…[:)][:)][:)]

Hi Akhilesh,

On Form 43 the SubFormLink property is set to Document No.=FIELD(No.)

This means for every new line on the subform the Document No. will already be set.

On Form 47 the SourceTableView property is set to WHERE(Document Type=FILTER(Invoice))

When you create a new record in the subform, these values are automatically populated but if you use Zoom (Ctrl+F8) on a completely new record you will notice that these values are set but no others are (Sell-to Customer No. is still blank).

The actual setting of the fields you are talking about is in the OnValidate trigger of the “No.” field on the Sales Line table (ID=37).

Cheers,

Dave.

Hi Akhilesh,

On table 37 (Sales Line) there is a function GetSalesHeader, after this function is called the global record variable SalesHeader will have a instance of the header table 36 (Sales Header) and hence you can read all fields on it.

The same trick ca be applied on forms too, if you want to pass values from main form to subform, but in Navision most data acess codes are written on the tables and not forms.

Rajib

Sorry