Hello,
I was going to respond to the below thread, but I got the warning that Necroposting is discouraged, hence the new post: Serial Matching - ERP 10 - Epicor User Help Forum (epiusers.help)
I have the following code. While it is incomplete, I am following the trace I performed, and sadly running OnChangeMtlSerialNo() I get “Serial Match Material record not found.”
I appreciate your time! Once I get this figured out I am going to share the code with the community so no one else is stuck on this process. I already posted my code that performs the steps for serial number assignment.
Here is my code thus far:
// Loop through our serials and perform matching
foreach (var serialNum in selectedSerialNumbersTS.SelectedSerialNumbers)
{
var serialNumber = serialNum.SerialNumber;
var partNum = serialNum.PartNum;
string opRevMsg;
string opnoBOMMsg;
var serialNumberMatchingTS = serialMatchingSvc.ChangeSerialNum(serialNumber, partNum, String.Empty, jobNum, assemblySeq, out opRevMsg, out opnoBOMMsg);
string opQuestion;
serialMatchingSvc.ValidateAssembly(jobNum, assemblySeq, out opQuestion, ref serialNumberMatchingTS);
serialMatchingSvc.OnChangeMtlSerialNo("J", serialNumber, mtlSeq, ref serialNumberMatchingTS);
debugMsg("Serial Matching TS", serialNumberMatchingTS);
}
Here is what my Serial Number Matching tableset looks like befor ethe OnChangeMtlSerialNo call:
{
"SerialMatchHdr":[
{
"ColumnNames":0,
"Company":"401",
"JobNum":"000012",
"TopPartNum":"N00983203-1",
"RevisionNum":"3",
"PartDescription":"Precision Part, Machined, 83mm",
"TopSerialNum":"203-180066",
"SNStatus":"WIP",
"Quantity":15.00000000,
"CreateDate":"2022-11-22T00:00:00",
"EnableNewChildPart":false,
"AssemblySeq":0,
"FullyMatched":false,
"SourceIsJob":true,
"SysRowID":"eb9a20aa-747a-4789-8a0d-0e3ddad13830",
"RowMod":"",
"SpecifiedProperties":"/z8=",
"UserDefinedColumns":{
}
}
],
"SerialMatchAsmbl":[
{
"ColumnNames":0,
"Company":"401",
"AsmblSeqNum":267,
"BOMAssemblySeq":0,
"IsSerialTracked":true,
"TopPartNum":"N00983203-1",
"TopSerialNum":"203-180066",
"ReqByAsmblSeqNum":0,
"ParentPartNum":"",
"ParentSerialNo":"",
"ParentAssemblySeq":0,
"ParentPartDesc":"",
"ParentAsmblSeqNum":0,
"AsmblPartNum":"N00983203-1",
"AsmblSerialNo":"203-180066",
"AsmblPartDesc":"Precision Part, Machined, 83mm",
"QtyPer":1.0,
"PullQty":0.0,
"OverRunQty":0.0,
"RequiredQty":15.00000000,
"AddedByMatching":false,
"FullyMatched":false,
"ReqByAssemblySeq":0,
"RecNum":1,
"BOMSeq":0,
"BOMLevel":0,
"ParRowIDent":"00000000-0000-0000-0000-000000000000",
"FromReassignSNAsm":false,
"SysRowID":"e95d52b0-341b-4139-944f-bac998e627da",
"RowMod":"U",
"SpecifiedProperties":"P/B/Hw==",
"UserDefinedColumns":{
}
}
],
"SerialMatchMtl":[
{
"ColumnNames":0,
"Company":"401",
"SeqNum":268,
"TopPartNum":"N00983203-1",
"TopSerialNum":"203-180066",
"ParentPartNum":"N00983203-1",
"ParentSerialNo":"203-180066",
"ParentAssemblySeq":0,
"ParentPartDesc":"Precision Part, Machined, 83mm",
"ReqByAsmblSeqNum":267,
"ParentAsmblSeqNum":267,
"MtlPartNum":"N00910101-1",
"MtlSerialNo":"",
"MtlPartDesc":"Preform,Precision Part 83mm",
"BOMMtlSeq":10,
"BOMAssemblySeq":0,
"QtyPer":1.0,
"AddedByMatching":false,
"ParRowIDent":"e95d52b0-341b-4139-944f-bac998e627da",
"BOMMtlSeqNum":1,
"FromReassignSNAsm":false,
"SysRowID":"9a50ceca-24d0-4ea8-a5e9-ab837fcc66b5",
"RowMod":"U",
"SpecifiedProperties":"//8/",
"UserDefinedColumns":{
}
}
],
"AvailToMatch":[
],
"ExtensionTables":[
]
}