Hey guys, was really hoping I would be able to get this knocked out yesterday but didn’t have much luck.
What I want to accomplish is just to dispatch a requisition on an event or a field change. I’m following the trace, and trying to replicate it but I’m not sure where I’m going wrong.
I did notice the .Update and .CheckToDo method is returning false.
Here is a snippet of the code I’m working with:
{
ReqAdapter adapterReq = new ReqAdapter(Script.oTrans);
adapterReq.BOConnect();
// Declare and Initialize Variables
// TODO: You may need to replace the default initialization with valid values as required for the BL method call.
int intId = 1;
int reqNum = 1;
string reqUserId = "Aaron";
bool resetDispatch = true;
bool dispatchReq = false;
string dispatchId = "Aaron";
string nextActionID = "PO";
string dispIDList = string.Empty;
string dispNmList = string.Empty;
// Call Adapter method
bool idresult = adapterReq.GetByID(intId);
MessageBox.Show(idresult.ToString());
bool bndresult = adapterReq.BuildNextDispatcher(nextActionID, out dispIDList, out dispNmList);
MessageBox.Show(bndresult.ToString());
bool updresult = adapterReq.Update();
MessageBox.Show(updresult.ToString());
bool chkresult = adapterReq.CheckToDo(dispatchId);
MessageBox.Show(chkresult.ToString());
adapterReq.RDMenuFlags(reqNum, reqUserId, out resetDispatch, out dispatchReq);
// Cleanup Adapter Reference
adapterReq.Dispose();
}
And then (what I believe) are the relevant bits of the trace, of dispatching a requisition manually in the UI. I removed some of the GetList, IMPL, etc
<tracePacket>
<businessObject>Erp.Proxy.BO.ReqImpl</businessObject>
<methodName>BuildNextDispatcher</methodName>
<appServerUri></appServerUri>
<returnType>System.Void</returnType>
<localTime>2/28/2021 07:35:53:9185525 AM</localTime>
<threadID>1</threadID>
<executionTime total="13" roundTrip="11" channel="0" bpm="0" other="2" />
<retries>0</retries>
<parameters>
<parameter name="nextActionID" type="System.String"><![CDATA[PO]]></parameter>
<parameter name="dispIDList" type="System.String"><![CDATA[]]></parameter>
<parameter name="dispNmList" type="System.String"><![CDATA[]]></parameter>
</parameters>
</tracePacket>
<tracePacket>
<businessObject>Erp.Proxy.BO.ReqImpl</businessObject>
<methodName>Update</methodName>
<appServerUri></appServerUri>
<returnType>System.Void</returnType>
<localTime>2/28/2021 07:35:57:2698876 AM</localTime>
<threadID>1</threadID>
<executionTime total="333" roundTrip="283" channel="0" bpm="0" other="50" />
<retries>0</retries>
<parameters>
<parameter name="ds" type="Erp.BO.ReqDataSet">
<ReqDataSet xmlns="http://www.epicor.com/Ice/300/BO/Req/Req" />
</parameter>
</parameters>
<paramDataSetChanges>
<paramDataSet name="ds" useDataSetNbr="0">
<changedValue tableName="ReqHead" rowState="Modified" rowNum="0" colName="NextActionDesc"><![CDATA[Create PO]]></changedValue>
<changedValue tableName="ReqHead" rowState="Modified" rowNum="0" colName="NextActionID"><![CDATA[PO]]></changedValue>
<changedValue tableName="ReqHead" rowState="Modified" rowNum="0" colName="ReplyOption"><![CDATA[A]]></changedValue>
<changedValue tableName="ReqHead" rowState="Modified" rowNum="0" colName="ReqUserId"><![CDATA[Aaron]]></changedValue>
<changedValue tableName="ReqHead" rowState="Modified" rowNum="0" colName="UD_SysRevID"><![CDATA[System.Byte[]]]></changedValue>
</paramDataSet>
</paramDataSetChanges>
</tracePacket>
<tracePacket>
<businessObject>Erp.Proxy.BO.ReqImpl</businessObject>
<methodName>CheckToDo</methodName>
<appServerUri></appServerUri>
<returnType>System.Boolean</returnType>
<localTime>2/28/2021 07:35:57:7559362 AM</localTime>
<threadID>1</threadID>
<executionTime total="13" roundTrip="7" channel="0" bpm="0" other="6" />
<retries>0</retries>
<parameters>
<parameter name="dispatchId" type="System.String"><![CDATA[Aaron]]></parameter>
</parameters>
</tracePacket>
<tracePacket>
<businessObject>Erp.Proxy.BO.ReqImpl</businessObject>
<methodName>RDMenuFlags</methodName>
<appServerUri></appServerUri>
<returnType>System.Void</returnType>
<localTime>2/28/2021 07:35:57:8219428 AM</localTime>
<threadID>1</threadID>
<executionTime total="43" roundTrip="42" channel="0" bpm="0" other="1" />
<retries>0</retries>
<parameters>
<parameter name="reqNum" type="System.Int32"><![CDATA[1]]></parameter>
<parameter name="reqUserId" type="System.String"><![CDATA[Aaron]]></parameter>
<parameter name="resetDispatch" type="System.Boolean"><![CDATA[False]]></parameter>
<parameter name="dispatchReq" type="System.Boolean"><![CDATA[False]]></parameter>
</parameters>
</tracePacket>
I was able to call the ResetDispatch method without problem. I tried using an EpiDataView to update those fields and setting RowMod = “U”, with no dice. I’m also not entirely sure if I need to use .GetByID here, because at this point the data is already returned to the UI.