March 3, 2023, 1:43pm
I have a Standard Directive on the MtlQueue table which should send an API request per individual line in the Material Queue. I need the Post call to the API to happen after the new record has written to the table so I have to use Standard Directive.
I cannot get around the ‘ttMtlQueue has mulitple records’ error message.
The Directive is as below.
This works perfectly fine in In Transaction but it posts to the API too soon as we have records sat in waiting and then a program will remove the records from the material queue.
I am unsure how to get around the multiple row issue!
March 4, 2023, 12:23am
In your SetMtlSeq Var 1, you are trying to set it to the value of 1 row, when there are more than
one. You either need to process for all rows, or pick a row to get your value from.
March 6, 2023, 8:41am
@klincecum I would need to process for all rows… not too sure how i would go about that?
March 6, 2023, 2:36pm
I think I was reading/looking at it wrong the first time.
March 6, 2023, 2:37pm
Have you tried moving this from a data directive, to a post-processing method directive?
March 6, 2023, 3:05pm
I have tried running this through MaterialQueue.Update Post Processing but it doesnt run.
March 6, 2023, 3:30pm
but it doesnt run
What does that mean ?
Have you done a trace and seen exactly what is called normally?
It may not be Update.
March 6, 2023, 3:49pm
I ran a trace but it returns no Methods.
I am trying to hook onto a process that was created by a third party consultant.
the In Transaction directive on the MtlQueue table is the only directive that seems triggers anything.
I have resorted to using the below to figure out which methods or tables i can use in Post but nothing happens.
Just to add, with the standard process i can trigger andy bpm to run
March 6, 2023, 3:51pm
How is this method kicked off in the first place?
March 6, 2023, 3:54pm
Its a scheduled function to create material queue records.
March 6, 2023, 3:57pm
Can we see that part, or could you describe it?
March 6, 2023, 4:01pm
The only reference on the function is this dll file.
I cant get into it, it seems to be locked.
We run it on a schedule and it picks up any sales orders that can be picked in the warehouse and sends them out to the material queue for picking. It auto allocates to available warehouse bins, skipping the Fulfilment Workbench.
March 6, 2023, 4:05pm
Ok, let me think on it. Or maybe someone else will understand the data directive problem better.
March 6, 2023, 7:17pm
Data Directives work on a single record at a time.
You should set the value of callContextBpmData.Number01 prior to enabling the Std DD.
I think the InTran DD would flow like:
Set callContextBpmData.Number01 to the value you want to pass to the Std DD
Call the Enable Standard Directive widget.
Then in the Std DD
Condition block to see if it was called from the InTran DD
Build your email, using the DD’s table for the new value and the callContextBpmData.Number01 as the prior value
Pay particular attention to the posts by
But the rest are essential as well.
The gist I got from it is do your work in the in trans data directive,
and pass it to the standard through the call context data or some other means
and do your final work/post there.
March 6, 2023, 9:24pm
@klincecum I have managed to get the Standard Directive firing and bringing over the MtlQueueSeq field from in transaction. which is a great start so thank you for pointing me in that direction.
First issue. if i update 4 records i only get the latest record not the preceding 3.
Second issue, The post to the API fails but i imagine it is to do with the below error from Event Viewer.
March 6, 2023, 9:26pm
That is correct.
You will need to somehow store the data you need for processing, and do your processing
off of that.
You only get the last record written.
March 6, 2023, 9:27pm
by storing do you mean use the BPM Data fields in in-transaction to store data i want to use in Standard Directive?
March 6, 2023, 9:29pm
Yes, at least that’s what I would try first.
Your in-trans will fire for each record.
I would use a Character field and add data with a delimiter, or json object, on each iteration, and
pick it up in the standard.
March 8, 2023, 2:52pm
I have made some progress.
I can create .txt files for each record updated which contains the correct data from within Standard Directives using.
I cant however trigger the API post code block after this using the code.
March 8, 2023, 2:58pm
If you’re going to go down this road, I would suggest a slightly different approach.
I would choose a UD table, or the systag table, and add a record or a tag for each updated
Then you could query in the standard directive for that data, act upon it, and then delete or mark
the temporary rows inactive.
I’m unsure exactly what you mean about not being able to trigger what you need next.
I’m going to ask some questions in the next post to keep it separate.