On our Job Materials we populate the Find Number (JobMtl.FindNum)
I’m trying to get this to show up in Mass Issue to MFG to help us selectively issue easier.
I’ve been messing with Method Directive, but cannot get the lookup to work correctly.
I will be replacing the LotNum field in the grid with the FindNum. I can do this with a static value successfully.
foreach (var ttMassIssue in (from row in result.MassIssue select row))
{
var dbJobMtlFindNum = (from row in Db.JobMtl
where
row.Company == Session.CompanyID &&
row.JobNum == ttMassIssue.JobNum &&
row.AssemblySeq == ttMassIssue.AssemblySeq &&
row.MtlSeq == ttMassIssue.SeqNum &&
row.PartNum == ttMassIssue.PartNum
select row).FirstOrDefault();
// string FindNum = dbJobMtlFindNum.FindNum;
string FindNum = "TEST";
ttMassIssue.LotNum = FindNum;
// Might need these for initialize - I dont know what im doing
string ipSysRowId = Convert.ToString(ttMassIssue.SysRowID);
string pcMessage;
string pcQuestion;
string pcError;
I tried that line of code earlier but getting an error. I dont know what its looking for. Same thing with message box.
If I use a static value it shows up ttMassIssue.LotNum = “TEST”;
Anything else from JobMtl throws error.
Maybe missing Null check?
Server Side Exception
BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
Exception caught in: Epicor.ServiceModel
Error Detail
Correlation ID: b69a6e6e-034b-400d-9873-425c00de567b
Description: BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
Program: Erp.BO.MassIssueToMfg.BuildMassIssueBrowse.dll
Method: A001_CustomCodeAction
Original Exception Type: NullReferenceException
Client Stack Trace
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.MassIssueToMfgImpl.BuildMassIssueBrowse(MassIssueInputDataSet ds, String ipSysRowID, String& pcMessage)
at Erp.Adapters.MassIssueToMfgAdapter.BuildMassIssueBrowse(String ipSysRowID, String& pcMessage)
at Erp.UI.App.MassIssuetoMfgEntry.MassIssueTransaction.BuildMassIssue()
Inner Exception
Object reference not set to an instance of an object.
So nothing can be used from the dbJobMtlFindNum var. I think I need to use a GetRows method or something to do my lookup. I’m searching but not really sure how to simply get results from another table that are joined from my db.results
Your approach is perfectly valid, you should probably check those tt Variables to make sure they are what you expect them to be, because for some reason you aren’t getting back any rows.
Also check the companyID, make sure that table has it populated.
Had to exclude Mtl Seq 0 or the assembly and mtl seq would not bind.
Mtl Seq 0 is the JobHead.PartNum They just lumped it in with the results of the JobMtl when the BO runs for Mass Issue.
ChatGPT wrote a lot of it for me.
I dont know how to post the code so it looks nice, but i’ve marked it as solution.
Thanks for all the help and motivation =)
Final piece is to do customization or personalization to change the column name from ‘Lot Number’ to ‘Find Number’
We do not use lot number so that was the field I chose to replace.
you can do singles like `text here`
which does text here
optional, you can specify a format for syntax higlighting on the first line:
Like for csharp = cs, don’t know what all options there are
```cs
//code here
//and here
```
I do have to find another home or another way to store it on the grid, since its now writing to the part transaction log after Mass Issue. Even though we don’t use lots, I dont need that data inserted into whatever table that is.
Trans Reference probably be find and I can just append it. or Pre-pend.
Probably callContextBPMData, then overwrite with a customization.
Edit:
Using ‘Reference’ column which writes to PartTran.Reference