web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

Change RFQ purchase order status as draft insted of default approved

Community Member Profile Picture Community Member

When we create purchase order using RFQ its default approval status will be approved.

To change that status to draft write following code where we will change its status to draft.

create new class and add following code

class CFSPOStatusRfq

{

    [PostHandlerFor(classStr(PurchAutoCreate_RFQ), methodStr(PurchAutoCreate_RFQ, endUpdate))]

    public static void PurchAutoCreate_PurchReq_Post_endUpdate(XppPrePostArgs args)

    {

        //PurchTable  purchTable = args.getThis(‘purchTable’);

        PurchAutoCreate_RFQ purchReq = args.getThis() as PurchAutoCreate_RFQ;

        PurchTable  purchTable, purchTablenew;

        purchTable = purchReq.parmPurchTable();

        ttsbegin;

        select forupdate purchTablenew where purchTableNew.PurchId == purchTable.PurchId;

        if(purchTablenew && purchTablenew.DocumentState == VersioningDocumentState::Approved)

        {

            purchTablenew.DocumentState = VersioningDocumentState::Draft;

            purchTablenew.update();

        }

        ttscommit;

    }

}

The post Change RFQ purchase order status as draft insted of default approved appeared first on .


This was originally posted here.

Comments

*This post is locked for comments