I’m trying to create an updateable BAQ for users to be able to set or modify the primary warehouse and bin.
I see that the fields aren’t DB fields, so I’m trying to use the advanced BPM to write a base processing directive to use the BO and update the data set, but I’m getting an out of range error. Can someone point me in the right direction?
Here’s the code I’m running on base:
foreach(var r in ttResults.Where(r => r.Updated()))
{
using(var partBO = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.PartSvcContract>(Db))
{
string desc = (
from wb in Db.WhseBin.With(LockHint.NoLock)
where wb.Company==Session.CompanyID && wb.BinNum==r.PlantWhse_PrimBin
select wb.Description).ToString();
PartTableset pds = new PartTableset();
pds.PartWhse[0].PrimBinNum = r.PlantWhse_PrimBin;
pds.PartWhse[0].PrimBinNumDescription = desc;
partBO.Update(ref pds);
}
}
And this is the method called in the trace logs:
<tracePacket>
<businessObject>Erp.Proxy.BO.PartImpl</businessObject>
<methodName>Update</methodName>
<appServerUri>net.tcp://isiepicor/PILOT/</appServerUri>
<returnType>System.Void</returnType>
<localTime>3/16/2018 07:34:14:7779543 AM</localTime>
<executionTime total="629" roundTrip="566" channel="0" bpm="0" other="63" />
<retries>0</retries>
<parameters>
<parameter name="ds" type="Erp.BO.PartDataSet">
<PartDataSet xmlns="http://www.epicor.com/Ice/300/BO/Part/Part" />
</parameter>
</parameters>
<paramDataSetChanges>
<paramDataSet name="ds" useDataSetNbr="0">
<changedValue tableName="PartWhse" rowState="Modified" rowNum="0" colName="PrimBinNum"><![CDATA[WIP]]></changedValue>
<changedValue tableName="PartWhse" rowState="Modified" rowNum="0" colName="PrimBinNumDescription"><![CDATA[WIP - Work in Process]]></changedValue>
</paramDataSet>
</paramDataSetChanges>
</tracePacket>
When I try and update, I get this error:
Server Side Exception
BPM runtime caught an unexpected exception of ‘ArgumentOutOfRangeException’ type.
See more info in the Inner Exception section of Exception Details.
Exception caught in: Epicor.ServiceModel
Error Detail
Description: BPM runtime caught an unexpected exception of ‘ArgumentOutOfRangeException’ type.
See more info in the Inner Exception section of Exception Details.
Program: CommonLanguageRuntimeLibrary
Method: ThrowArgumentOutOfRangeException
Original Exception Type: ArgumentOutOfRangeException
Framework Method: A001_CustomCodeAction
Framework Line Number: 0
Framework Column Number: 0
Framework Source: A001_CustomCodeAction at offset 1441 in file:line:column :0:0
Server Trace Stack: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at Epicor.Customization.Bpm.UbaqAA1B173E317A427497ABBF4811474172.UpdateBaseDirective_BASE_ADW_7155508E611643E4812270BF77196D80.A001_CustomCodeAction()
at Epicor.Customization.Bpm.UbaqAA1B173E317A427497ABBF4811474172.UpdateBaseDirective_BASE_ADW_7155508E611643E4812270BF77196D80.ExecuteCore()
at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in c:_Releases\ICE\3.1.500\Current\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 160
Client Stack Trace
at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Ice.Proxy.BO.DynamicQueryImpl.Update(DynamicQueryDataSet queryDS, DataSet queryResultDataset) at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass64_0.<Update>b__0(DataSet datasetToSend) at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func
2 methodExecutor, Boolean refreshQueryResultsDataset)
at Ice.Adapters.DynamicQueryAdapter.Update(DynamicQueryDataSet queryDS, DataSet updatedDS, Boolean refreshQueryResultsDataset)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.b__358_0(Int32& rowReturned)
at Ice.UI.App.BAQDesignerEntry.Forms.BAQDiagramForm.ShowQueryResults(DataSet dsResults, getQueryResult getResults, ReportAdditionalInfo additionalInfo)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.CallUpdate()
Inner Exception
Specified argument was out of the range of valid values.
Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index