How to fetch data from list form to sales line

Markandey_PandeyMarkandey_Pandey Member Posts: 178
Hi all,

I have created a table called "Challan Details" with some fields like Vendor Invoice No, Customer No. Item no , Description and Received Qty and i am inserting records in this table when purchase order is received.

Problem:1

When Line contains more than one item then how to insert these details in "Challan Details" Table. Following is the code I have written when there is a single line:
//RecRcDetail is a variable of type "Challan Details" 
RecRcDetail.INIT;
 RecRcDetail."Rc. No.":="Vendor Invoice No.";
 RecRcDetail."Customer No.":="Pay-to Vendor No.";
RecRcDetail."Customer Name":="Pay-to Name";
RecRcDetail."Item No.":=RecPurchaseLine."No.";
RecRcDetail."Item Description":=RecPurchaseLine.Description;
RecRcDetail."Received Qty":=RecPurchaseLine."Qty. to Receive";
 RecRcDetail.INSERT;
I have added one field called "vendor Invoice No." in Sales Header table and have set the "Table Relation" Property of this table to the "Challan Details" table that i have created so that i can pick the data from this table.

Problem II:
Here what i want is to fetch the data like item no,description and qty from "Challan Details" table
and set in sales line on sales order form when i choose the vendor invoice no from Challan Details table.

can anybody help me to get rid of these two problems.
Markandey Pandey

Comments

  • matttraxmatttrax Member Posts: 2,309
    If the line already exists, then I would guess you are receiving more of the product. If that is the case you need to see if it already exists, and if it does increment the quantity received.

    So you want to copy items from the purchase lines to your details table and then again to your sales lines? Why not just use Copy Document? Get rid of the middle table.
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    matttrax wrote:
    If the line already exists, then I would guess you are receiving more of the product. If that is the case you need to see if it already exists, and if it does increment the quantity received.

    So you want to copy items from the purchase lines to your details table and then again to your sales lines? Why not just use Copy Document? Get rid of the middle table.


    But how can I copy Purchase document on sales order screen using copy document, it will show me only sales documents not purchase documents.
    Markandey Pandey
Sign In or Register to comment.