Selasa, 09 September 2014

PR approved is not exist in the form Release approved purchase requisitions

There's an unexpected moment when an Approved Purchase Requisition is not collected by Release approved purchase requisition form. ... something silly rite?
but, yes ... iv got that problem.
This case is happen when the Accounting status field on Sourcedocumentline table is set to 'Fully distributed'. i dont know why this accounting status field is set to 'Fully distributed', i mean the trigger that's makes the status become 'Fully distributed'.
So,... in this case u can fix this problem by set the Accounting status to become 'Completed'.

U can use the script from the Job.

Use the PurchTable, Purchline and SourceDocumentline.

Select PRtable where Prtable.PurchReqId == "XXXX";
    while select PRline where PRline.PurchReqTable == PRtable.RecId
    {
        Select forUpdate documentline where documentline.RecId == PRline.SourceDocumentLine;
        {
            info(strFmt("PRlinenum : %1, Documentstatus : %2",PRline.LineNum,documentline.AccountingStatus));
             ttsBegin;
            documentline.AccountingStatus = SourceDocumentLineAccountingStatus::Completed;
            documentline.update();
            ttsCommit;
                    }


    }


Tidak ada komentar:

Posting Komentar

Erorr CS1963 - An expression tree may not contain a dynamic operation.

Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...