Hi Experts,
I made custom workflow for Sales Order as well Sales Quotation.
In Sales Order, after Sales order workflow approved then only confirmation button enable.
The code is given below.
boolean mayConfirmationBeUpdated() { boolean ok; ok = (!(salesTable.SalesStatus == SalesStatus::Invoiced || salesTable.SalesStatus == SalesStatus::Delivered || salesTable.SalesStatus == SalesStatus::Canceled) && (salesTable.mcrOrderStopped == NoYes::No || !isConfigurationkeyEnabled(configurationKeyNum(MCRCallCenter)) && (salesTable.CreditLimitApprovalStatus == SalesCreditLimitApprovalStatus::Approved || salesTable.DiscPercent == 0)) //SFA added 23Nov20 ); if (ok && salesCycle) { salesPurchCycle = SalesPurchCycle::findBySalesPurchaseCycle(SalesPurchCycleAction::Confirmation, SalesPurchCycleModuleParameter::Cust, salesTable.CustAccount); if(salesPurchCycle) { if(!salesPurchCycle.Active) { ok = false; } } else { if (!SalesPurchCycle::findBySalesPurchaseCycle(SalesPurchCycleAction::Confirmation, SalesPurchCycleModuleParameter::CustParameter, '').Active) { ok = false; } } } return ok; }
In Sales Quotation, What changes are required to get same as per Sales order means after workflow get approved then only confirmation button enable.
The standard code is given below.
boolean mayConfirmationBeUpdated() { //only if workflow is approved enable send button //if sales quotation customer is prospect, should return false return (salesQuotationTable.BusRelAccount == '' && !salesQuotationTable.isTemplate() && (salesQuotationTable.QuotationStatus == SalesQuotationStatus::Sent && salesQuotationTable.CustAccount && smmOpportunityTable::find(salesQuotationTable.OpportunityId).Status != smmOpportunityStatus::Postponed ) ); }
Thanks in advance..
Regards,
Faiz