Calling MassIssue in Data BPM Error

I am getting the below error when trying to call the MassIssueToMfg.IssueAll() and MassIssueToMfg.BuildMassIssueBrowse.

I have posted the code below that.

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 
Correlation ID:  6947ecd0-7fb8-4e9a-85fe-efd61e12f94b
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 382 in file:line:column <filename unknown>:0:0
Client Stack Trace 
   at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
   at Erp.Proxy.BO.JobEntryImpl.Update(JobEntryDataSet ds)
   at Erp.Adapters.JobEntryAdapter.OnUpdate()
   at Ice.Lib.Framework.EpiBaseAdapter.Update()
   at Erp.UI.App.JobEntry.Transaction.Update()

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
using (var hMassIssue = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.MassIssueToMfgSvcContract>(Db))
  var job = ttJobHead.Where(x => x.Updated()).FirstOrDefault();
  //var jobAsm = Db.JobAsmbl.Where(y => y.Company == job.Company && y.JobNum == job.JobNum && y.Plant == job.Plant).FirstOrDefault();
  string ipSysRowId = Convert.ToString(job.SysRowID);
  string pcMessage;

  //Build table set for build
  Erp.Tablesets.MassIssueInputTableset buildTS = new Erp.Tablesets.MassIssueInputTableset();
  buildTS.MassIssueInputJob[0].JobNum = job.JobNum;
  buildTS.MassIssueInputJob[0].SysRowID = job.SysRowID;
  buildTS.MassIssueInputJob[0].IsReturn = false;
  buildTS.MassIssueInputJob[0].Company = job.Company;
  buildTS.MassIssueInputJob[0].dummyKeyField = string.Empty;
  buildTS.MassIssueInputJob[0].WarnMessage = string.Empty;
  buildTS.MassIssueInputJob[0].RowMod = "U";
  Erp.Tablesets.MassIssueToMfgTableset massTS = hMassIssue.BuildMassIssueBrowse(ref buildTS, ipSysRowId, out pcMessage);
  hMassIssue.IssueAll("Open", ref massTS);


It just means that the index 0 data doesn’t exist.

buildTS.MassIssueInputJob[0] // row 0 does not exist

You need to first create a new Row. Chances are there is a hMassIssue.GetNewSomething(ref buildTS...) method.

1 Like