Hi folks,
I’m creating a temporary job in a BPM to pull in with a Get Details in Quote Entry.
Getting to this point where I add the JobProd record, and I receive a “Quantity is invalid” error message.
I’ve queried out the data from entering a job in Job Entry and the data created in the BPM. Although I can’t save the BPM JobProd record, I don’t see any difference in what I’m putting in the record and what is saved in the Job Entry version.
Here’s the code I’m using.
// create a job from Fan Selector data in UD03
bool createJob = false;
Erp.Contracts.JobEntrySvcContract jobEntry = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(this.Db, true);
try
{
jobEntry.DeleteByID(“JTTest”);
}
catch
{
}
string externalReferenceID = callContextBpmData.Character01;
if (externalReferenceID != “”)
{
using(var txscope = IceDataContext.CreateDefaultTransactionScope()) //Start Transaction
{
jobEntry.GetNewJobHead(ref dsJob);
var JobHead_xRow = (from JobHead_Row in dsJob.JobHead
// where JobHead_Row.RowMod == “A”
select JobHead_Row).FirstOrDefault();
if (JobHead_xRow != null)
{
JobHead_xRow.JobNum = “JTtest”;
JobHead_xRow.PartNum = “FSQuoteJobSetup”;
JobHead_xRow.PartDescription = “FSQuoteJobSetup”;
JobHead_xRow.InCopyList = true; // template
JobHead_xRow.ReqDueDate = DateTime.Today;
JobHead_xRow.Plant = callContextClient.CurrentPlant;
//JobHead_xRow.IUM = “EA”; // comes from change part num
jobEntry.ChangeJobHeadPartNum(ref dsJob);
JobHead_xRow.JobEngineered = true; // this section doesn’t seem to make a difference to creating job prod record
jobEntry.ChangeJobHeadJobEngineered(ref dsJob);
JobHead_xRow.JobReleased = true;
jobEntry.ChangeJobHeadJobReleased(ref dsJob);
jobEntry.Update(ref dsJob);
dsJob = jobEntry.GetByID(JobHead_xRow.JobNum); // okay here
//Boolean [varName] = [varAdapterName].GetNewJobProd(jobNum, partNum, orderNum, orderLine, orderRelNum, warehouseCode, targetJobNum, targetAssemblySeq);
jobEntry.GetNewJobProd(ref dsJob, JobHead_xRow.JobNum, JobHead_xRow.PartNum, 0, 0, 0, string.Empty, string.Empty, 0);
dsJob.JobProd[0].WIPToMiscShipment = true;
dsJob.JobProd[0].ProdQty = 1;
dsJob.JobProd[0].WIPQty = 1; // doesn’t seem to/shouldn’t make a difference
jobEntry.Update(ref dsJob); // Displays "Quantity is invalid." error message.
All kind efforts exempted from the “No good deed goes unpunished” rule.
Thanks,
Joe
Business Layer Exception
Quantity is invalid.
Exception caught in: Epicor.ServiceModel
Error Detail
Description: Quantity is invalid.
Program: Erp.Services.BO.JobEntry.dll
Method: jobprodGoOfFrame
Line Number: 35866
Column Number: 29
Table: JobProd
Client Stack Trace
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.QuoteImpl.Update(QuoteDataSet ds)
at Erp.Adapters.QuoteAdapter.OnUpdate()
at Ice.Lib.Framework.EpiBaseAdapter.Update()
at Erp.UI.App.QuoteEntry.Transaction.Update()