I’m looking to default the JobOpDtl.ResourceID field to “unassigned” every time an operation is added, the only condition i need is only do this when the field is blank.
Here is some ABL i have written but it doesn’t seem to work:
For each ttJobOpDtl no-lock.
If ttJobOpDtl.ResourceID = ? Then Do:
/* Set the ResourceID field of the added row to the “unassigned” expression */
Assign ttJobOpDtl.ResourceID = “Unassigned”.
End.
End.
I have applied this ABL to a Data Directive using the JobOpDtl table in the Standard tab.
This code needs to work when:
a job is added through job entry manually.
when MRP is ran and unfirmed jobs are created through their too.
What I would do instead is create a Method Directive under JobEntry.Update that has a criteria stating that ""There is at least one added row in the ttJobOpDtlTable. Then try utilizing the following code:
Find First ttJobOpDtl Where ttJobOpDtl.RowMod = ‘A’ or ttJobOpDtl.RowMod = ‘U’ no-lock.
If Available ttJobOpDtl then do: Assign ttJobOpDtl.ResourceID = “Unassigned”.
I tried this as per screenshots - but still no joy.
I wasn’t 100% sure on how to write the condition, so i thought well if i can get something going for no conditions that would be a good start, but nothing.
Sorry about that, I should have clarified that it should be in the Pre-Processing! As far as I’m aware, you can only update the temporary tables in the Pre and Base processing. (I also stray away from using Base-Processing as this is when the Epicor process is active for the function and it’s better to perform user functions before or after it)
Alright, got it figured out! Head back to what you were doing originally in Data Directives, but utilize the In-Transaction instead of Standard. And then try out the following code again with the condition set to “There is at least one added row in the ttJobOpDtl table”.
Find First ttJobOpDtl Where ttJobOpDtl.RowMod = ‘A’ or ttJobOpDtl.RowMod = ‘U’ no-lock.
If Available ttJobOpDtl then do: Assign ttJobOpDtl.ResourceID = “Unassigned”.
Hi Kevin,
I think it works - the only bit im not sure about is i need it to be only applied where the resourceID field is blank.
So if its normally filled with data, to leave it be…which maybe just another condition?
So, its certainly getting closer, it just requires a further condition either in the ABL or directly in the BPM to only apply it when the field is null/blank.