Select the data in main form and give the value in subform

Hi expert,

Can we give the value into sub form when we’ll select in main form. For Ex,

If we created a field “Sales Order No.” in Purchase Order Main Form and this field will filter the “Sales Order No.” in Sales Header Table and I have done the SETRANGE with Sale Line Table but how we can put values of Sales Line Table Data to “Purchase Order Sub Form”.

Thanks & Regards,

Rishi Mohan

Just look at the copy document functionality of Navision.

If what you really need is functionalty to link sales orders to purchase orders, then this functionality exists as standard and in two editions. This functionality is either called “Drop shipments” or “Special Orders”, but it works pretty much the same. Drop shipments are when you sell something to a customer, but have your vendor ship it directly to your customer. So the functionality you must look at is the “Special Orders”.

When you create your purchase order, then you start by filling out the “Sell-To Customer No.” on the Shipping tab of your purchase order. After this you can select the function Order->Special Orders->Get Sales Order - this will pull in the sales order lines into your purchase order lines and link them so that cost prices etc. are linked.

Dear Erik & Amol,

Really thanks for quick reply but it’s just like a Ex. in my scenario I created two customized tables [‘A’] Header & [‘B’] Line & Created One form {Main-Sub Form Type} in which [‘A’] as a header and [‘B’] as line now i am giving the reference the No. of [‘A’] to Purchase Order Form and want to get only some fields of [‘B’] into PurchaseOrderSubForm but i get confused whether i have to put values in PurhcaseOrderSubForm or in Purchase Line Table.

Hi Rishi,

I’m sorry but I don’t understand your reply. What are you really trying to do? What is the actual requirement? (Not what you are doing in terms of specific code in forms or tables).

Do you mean to say You want fill some fields in B table on the basis of selecting one field from table A???

Apologies For Late Reply ,

I’ll tell you a real scenario I have create a Form RequistionOrder in which i took two tables Requistion Header and Requisition Line so One Requisition Header can Have Multiple Requistion Lines now i have customized the Purchase Order Form and given the Reference of Requistion Order No. so i want to get all requisition lines data in Purchase order.But i am really confused i tried to put data in Purchase Line but its not Reflecting in Purchase Order.I am not getting how to value will reflect in SubForm (Purchase Order Sub Form) .

Dear Amol,

Thanks for cooperate actually i want to select field of table [‘A’](Header Table) in purchase order and want to feed some values of table [‘B’] (Line Table) in Purchase Order.

Do you know in Requisition Worksheet there is one function called ‘**Carry out Action message’ .**You can use this functionality to create Purchase order automatically from requisition

For your scenario

  1. Create one field in Purchase Header called ‘Requisition No’

  2. Write a code on onValidate trigger of above field for inserting the relevant data from requisiton table to Purchase line table

  3. If you want that user should select from lookup then create List form of requisiton header and attached that list to above field

I hope This will help you.

Really thanks Amol [:)]

Welcome Rishi…