Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

partial product receipt for purchase order

$
0
0

hi this is my code for partial product recipt for PO

static void Job219(Args _args)
{
    PurchFormLetter   PurchFormLetter;
    PurchLine         PurchLine,PurchLineloc;
    SON_AttachmentELMOInvoice       attachmentELMOInvoice;
    str  invoiceNumber;
    PurchTable  purchTable;
    int i=0;

    purchTable = purchTable::find('00002639 ');


   PurchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

    while select PurchLine group by DeliveryDate
       where PurchLine.PurchId == purchtable.PurchId
    {
        ttsBegin;

        while   select PurchLineloc  where PurchLineloc.DeliveryDate == PurchLine.DeliveryDate
            && PurchLineloc.PurchId == purchtable.PurchId
        {
            PurchLineloc.selectForUpdate(true);
            PurchLineloc.InventReceivedNow = PurchLineloc.PurchQty;
            PurchLineloc.PurchReceivedNow = PurchLineloc.PurchQty;
            PurchLineloc.update();

        }

        ttsCommit;

        invoiceNumber = "rdgt133fs";

       PurchFormLetter.update(purchtable,invoiceNumber,attachmentELMOInvoice.DeliveryDate,PurchUpdate::ReceiveNow);

    }

}

I  am getting an error as "

Cannot edit a record in Purchase order lines (PurchLine).
An update conflict occurred due to another user process deleting the record or changing one or more fields in the record."

 

any help what exactly i am doing wrong


Viewing all articles
Browse latest Browse all 143529

Trending Articles