Hello All,
I have added two fields in purch. rcpt. line,purch inv. line,its header tables and other related tables.The added field values are inserted in the purchase order while invoicing only.So,I have to pass that value to their corresponding purch. rcpt. line which has been already posted.I wrote the following code but cannot figure it out where to put it exactly.
PurchRcptLine.SETRANGE("Document No.","Document No.");
IF PurchRcptLine.FINDFIRST THEN BEGIN
ItemLedgEntry.SETRANGE("Document No.",PurchRcptLine."Document No.");
IF ItemLedgEntry.FINDFIRST THEN REPEAT
IF ItemLedgEntry."Document Type" = ItemLedgEntry."Document Type"::"Purchase Receipt" THEN BEGIN
ValueEntry.SETRANGE("Item Ledger Entry No.",ItemLedgEntry."Entry No.");
IF ValueEntry.FINDFIRST THEN BEGIN
IF ValueEntry."Document Type" = ValueEntry."Document Type"::"Purchase Invoice" THEN BEGIN
RcptLinePragyapan := ValueEntry.PragyapanPatra;
RcptLineLC := ValueEntry."Letter of Credit/Telex Trans.";
PurchRcptLine.SETRANGE("Document No.",ValueEntry."Document No.");
IF PurchRcptLine.FINDSET THEN REPEAT
PurchRcptLine.PragyapanPatra := RcptLinePragyapan;
PurchRcptLine."Letter of Credit/Telex Trans." := RcptLineLC;
PurchRcptLine.MODIFY;
UNTIL PurchRcptLine.NEXT = 0;
END;
END;
END;
UNTIL ItemLedgEntry.NEXT = 0;
END;
*This post is locked for comments