Hi Team,
On Maintain vendor invoice form i have loaded few product receipt. and created one button on action menu which submit all records present on form grid to work flow as user don't want to go one by one to each record and submit it.
Issue - Issue is when submit manually one record at a time, after submit it display action work flow strip but when same record i am submitting from code using below method, its not showing action stripe , it keeps showing yellow submit strip.
below code i have written on button click
void clicked()
{
#define.WorkFlowTemplateName("VendProcessInvoice")
VendInvoiceInfoTable VendInvoiceInfoTableBuff,VendInvoiceInfoTableUpdate;
super();
VendInvoiceInfoTableBuff = VendInvoiceInfoTable_ds.getFirst() as VendInvoiceInfoTable;
while(VendInvoiceInfoTableBuff)
{
try
{
if(VendInvoiceInfoTableBuff.RequestStatus == VendInvoiceRequestStatus::Draft && VendInvoiceInfoTableBuff.RecId != 0)
{
Workflow::activateFromWorkflowType(#WorkFlowTemplateName, //Template name
VendInvoiceInfoTableBuff.RecId, //Record id of the document that you are submitting,
'Workflow submitted by button SubmitAllToWorkflow', //A comment for the workflow history to know something about how this was submitted,
false, //This document wasn't submitted from the web,
Curuserid()); // The user who should become the workflow originator
//VendInvoiceInfoTable::setRequestStatus(VendInvoiceInfoTableBuff.RecId, VendInvoiceRequestStatus::InReview);
ttsbegin;
VendInvoiceInfoTableBuff.skipDataMethods(true);
update_recordset VendInvoiceInfoTableUpdate
setting RequestStatus = VendInvoiceRequestStatus::InReview,
VendInvoiceSaveStatus = VendInvoiceSaveStatus::Pending
where VendInvoiceInfoTableUpdate.RecId == VendInvoiceInfoTableBuff.recid;
ttscommit;
}
}
catch
{
error(strFmt("@SYS321204",VendInvoiceInfoTableBuff.Num));
}
VendInvoiceInfoTableBuff = VendInvoiceInfoTable_ds.getNext() as VendInvoiceInfoTable;
}
VendInvoiceInfoTable_ds.reread();
VendInvoiceInfoTable_ds.refresh();
element.refreshAfterWorkflowSubmit();
}