Standard Directive - Table has multiple rows

one sec

Erp.Bpm.TempTables.MtlQueueTempRow

usable in in trans & std

ok. heres what we have.

if( callContextBpmData.Character01.EndsWith(“|”) )
{
callContextBpmData.Character01 = callContextBpmData.Character01.Remove(callContextBpmData.Character01.Length - 1);
}

List rowsList = callContextBpmData.Character01.Split(‘|’).ToList();

callContextBpmData.Character01 = “”;

foreach(var rowStringJson in rowsList)
{

MtlQueueTempRow myRow = JsonConvert.DeserializeObject(rowStringJson);

}

I imagine this is what you mean by knowing how to deserialize it properly?

image

I got you a skeleton, hold one.

In-Trans

  //using Newtonsoft.Json;

  //This is probably all you need to do in-trans, unless you need to add conditions
  //Of course, if you do need conditions, you could filter later in the standard too
  callContextBpmData.Character01 += JsonConvert.SerializeObject(ttMtlQueue.First()) + "|";

Standard

  //using Newtonsoft.Json;

  callContextBpmData.Character01.TrimEnd('|');
  List<string> rowsList = callContextBpmData.Character01.Split("|").ToList();
  callContextBpmData.Character01 = "";
  
  foreach(string rowJson in rowsList)
  {
      Erp.Bpm.TempTables.MtlQueueTempRow rowToProcess = JsonConvert.DeserializeObject<Erp.Bpm.TempTables.MtlQueueTempRow>(rowJson);
      
      //Now you can do work with the row...
      var jobNum = rowToProcess.JobNum; //etc
      
      //Do whatever work you wanted to do before...
  }
1 Like

@klincecum
I have this working.
It is now posting to the API should the record end up making it to the standard Directive update!

I have some other issues but this is for the guys who programmed the function i am hooking onto.

Thank you for this.

1 Like

I lost some brain cells, so I’ll have a few beers and celebrate by losing some more. :beers:

Hi, I’m still having issues with sporadic material queue records.

I have the following row but the Standard directive does not fire after the in transaction runs, this is an output from the in-transaction.

The whole bpm works with every majority of records.

callContextBpmData.Character01 {“RowMod”:“A”,“Company”:“LIFT”,“SysDate”:“2023-03-09T00:00:00”,“SysTime”:49973,“MtlQueueSeq”:90918,“Plant”:“MfgSys”,“PartNum”:“00000”,“Quantity”:25.00000000,“TranType”:“STK-SHP”,“ReferencePrefix”:“SO:”,“Reference”:“918301/6/1”,“RequestedByEmpID”:“”,“SelectedByEmpID”:“”,“JobNum”:“”,“AssemblySeq”:0,“JobSeqType”:“M”,“JobSeq”:0,“FromWhse”:“NDC”,“FromBinNum”:“CAR01”,“ToWhse”:“SHIP”,“ToBinNum”:“SHIP”,“NextAssemblySeq”:0,“NextJobSeq”:0,“NeedByDate”:“2023-02-23T00:00:00”,“NeedByTime”:49973,“VendorNum”:0,“PurPoint”:“”,“PackSlip”:“”,“PackLine”:0,“OrderNum”:918301,“OrderLine”:6,“OrderRelNum”:1,“TargetJobNum”:“”,“TargetAssemblySeq”:0,“TargetMtlSeq”:0,“RevisionNum”:“”,“PartDescription”:“7W Firestay LED CCT Downlight - Dim, P&P, 3 Colour, 40°”,“IUM”:“EA”,“PONum”:0,“POLine”:0,“PORelNum”:0,“Visible”:true,“RMANum”:0,“RMALine”:0,“RMAReceipt”:0,“RMADisp”:0,“NCTranID”:0,“LotNum”:“”,“Lock”:false,“QueueID”:“”,“QueuePickSeq”:0,“ReleaseForPickingSeq”:13288,“WhseGroupCode”:“”,“TranStatus”:“RELEASED”,“WaveNum”:0,“Priority”:3,“TranSource”:“”,“LastMgrChangeEmpID”:“2177”,“AssignedToEmpID”:“”,“TargetTFOrdNum”:“”,“TargetTFOrdLine”:0,“PackStation”:“”,“DistributionType”:“HANDHELD”,“Obs10_PkgNum”:0,“Obs10_PkgLine”:0,“SysRevID”:“AAAAAAiuIno=”,“SysRowID”:“2750a609-6f33-4c07-9191-0df9fc7ef1a9”,“PCID”:“USE-FROMPCID-TOPCID”,“EpicorFSA”:false,“LastUsedPCID”:“”,“FromPCID”:“”,“ToPCID”:“”,“AttributeSetID”:0,“AttributeValueSeq”:0,“NumberOfPieces”:0,“UD_SysRevID”:“AAAAAAiuIns=”,“WhseSplit_c”:“”,“WhseSplitNum_c”:0,“EntityKey”:null}|

Are you positive it’s not firing, or some other failure?

100%.
On the Standard Directive I only have a code block which posts a string to the event logs so i know if it its triggered and it doesn’t for some records.

I also have the same post to event viewer with a different string just before the Enable Standard Directive widget. which writes everytime.

Next question, are you sure that record was written to the DB ?

As in, it succeeded.

yes, it exists in the Material Queue ready for processing.

1 Like

It’s possible the call context won’t work for this, or we’ve overlooked something.

I have a few other options, I will think on it.

thank you.

@klincecum

I have another possible solution around this.
Create a CSV file of all records (based on FromBinNum = x or y) in the Material Queue (using a function on a schedule)
This would have to be date and time dependent as records will arrive in the material queue in batches.

I am unsure how big of a task this is and exactly how to do this.

sorry for the spam but i could create a BAQ export as CSV and run that on a schedule.
the only problem with this is each export has to have the same file name.

No problem dude, I got an idea, just got to finish forming it.

Kid Fail GIF by MOODMAN

sweet, thanks.

Before I help him with a workaround, is there anybody who knows why
a standard directive wouldn’t fire even though the in-trans did, and was successful?

This definitely solved the problem.

My issue was i had another Epicor function running that stops the Standard Directive firing for some unknown reason.

Workaround was simple and works a treat :slight_smile:

Thank you.

1 Like