Read CSV, Update Material Queue and then Process the Record

Trace is the only way to know!

total physical response alo7 english GIF by ALO7.com

Not related but came up in search for relevant gif, couldn’t not share:

Dog Drawing GIF

I think i found it under ERP.BO.IssueReturn.SVC and custom method PerformMaterialMovement.
I need to load the mtlqueue data into the function so i can build the Issue Returns dataset in order to move the mtl queue record. Thank you for pointing me in the right direction!

i decided to change it up a bit.

I will use Powershell to read the CSV and call the Epicor Function but i decided to have a go using the widgets for the updating.
am i better using UpdateExt from a Function rather than Update method?
Also, should i use row mod as A or use U if the row already exists and im changing a field.

It doesn’t really matter as long as you have the proper data for the call.
You’ll end up at the same place in the end.

Editing → “U”
Adding → “A”
Deleting → “D”

Not sure why this isnt working as i expected… I have another directive doing similar on another table and that works…

image

The update is tableset is bound to the getbyid variable.
image

Then i use a fill table by query, pass all the data from the same tableset and change the to Bin and row Mod to U.

a simple bit of code wont update the record…
The correct data is passing into the function as i used an exception to show the 3 variables are available

image

No errors in event viewer…or in postman when testing the function.

You should probably use the business object instead of the Db context.

1 Like

If you are dead set on using the Db context though, you need to call:

Db.Validate() in a BPM, or Db.SaveChanges() in a function before txScopeComplete()

In a function, you will also have to enable read/write for that table, and in the tables screen
on the right side, allow edit/update/whatever it says lol.

so near yet so far.

This code works in postman to process a material queue record.
In Epicor however the first line in the body shows an error in event viewer.

The error given is Ice.Api.Exceptions.ApiException: Parameter plNegQtyAction is not found in the input object.

below is the working code in postman, im struggling to find the issue.

No need to call rest from inside.

If you do continue, IssueReturn should be an array.

I know but im struggling with adding a record to the IssueReturns method so i thought id try the rest method as i got that working ouside of epicor.

I understand how you feel. I’ll see if I can futz with it.

what are the long term issues of using rest inside epicor?

Slower, storing credentials inside, gotta keep up with them or keep them valid, etc

If you look at the trace when a queue is processed there are several methods that fire before the PerfomMaterialMovement. I assume one of them does the needed setup. I spotted an OkToProcess also.

here is a post using the methods in a customization that should be close.

1 Like

Hi, i managed to sort this with a simple Fill table by query (querying ERP.MtlQueue) and the Perform Movement method.

The whole proess was much simpler than i was making out, i didnt have to update the table first as i could just submit the To Bin as a parameter before method kicked in :slight_smile:

1 Like

Hi Ricky,

Will you be able to give some insights how you were able to manage this? Maybe some guidance? I am trying to create record in material queue triggered by a checkbox at JobMtl table in Job entry form.

Thanks in advance!!

@itsme
This is in a function but i imagine a standard data directive on the JobMtl table would be similar.

I believe the method you need is either MoveRequest.GetNewMoveRequest or IssueReturn.GetNewIssueReturn, fill the dataset you created (Invoke BO Widget) with a query