Change RFQ purchase order status as draft insted of default approved
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;
}
}
Related posts:
From Client Secrets to Certificate-Based Authentication: Building a Secure Integration with Azure Ke...

From Multiple Data Sources to Azure Databricks: A Zero-Downtime Power BI Report Data Migration for F...
Using AI for Data Discipline That Drives Better AI Outcomes

