I’ve added to UD fields to the LaborDtl to capture who approves or rejects Time Entries, so I can create a dashboard for the Mfg Manager. I’m trying to write a BPM to set the fields equal to the current userid, but the fields don’t get populated. I’ve tried with a Pre- and Post- Processing method directive and I’ve tried a data directive, but nothing has worked for me so far. Am I missing something?
Just wondering if you are using Erp.Labor.SubmitForApproval?
And have already tried adding messages to pre and post method directives?
Good point, Bruce - adding simple debug messages to the BPMs you think should be firing are quick indicators. If you don’t see the message pop up, the BPM isn’t being fired ( or that specific logic branch of the BPM isn’t being executed ).
I don’t see Erp.Labor.SubmitForApproval, but I am using LaborApproval. I did not add any messages so I will try that. Thanks.
My experience with BPM’s is often when it does not work I need to do a "Recycle IIS " then I can see my BPM in action…
Pierre
Sometimes you have to use a pre process to set a call contaxt field and then do a post process and Grab the call context field and update the fields you want
Mak sense?
David Moon
Principal Consultant
Cell: (513) 607-8249
email: dmoon@epicor.commailto:tpaulus@epicor.com
[cid:image001.jpg@01D19719.27085890]
Corporate Office 804 Las Cimas Parkway, Austin, TX 78746 USA
P Consider the Environment …please don’t print this e-mail unless you really need to
[http://www.epicor.com/uploadedimages/Shared/email-signatures/Epicor-Cloud-Email-Signatures-0116.jpg]http://www.epicor.com/
Not sure what you mean by using the pre process to set the call context field. Am I saving the call context field somewhere?
I think there are more than 100 methods for Labor
Maybe can try changing your search options or specify “start at” SubMitForApproval
FYI…
I did a quick test & both pre/post directive messages did pop up when I submitted from Time and Expense entry.
There are already standard fields for what you are requesting arent there? For sure its there for approved time/person.
For writing data in a BPM, you need to ensure you are using the PRE process. You shouldnt need to do anything special besides placing the data into the appropriate field. When you say nothing has worked, can you specify the exact issue. For example, do you get errors? Or does the data just not populate?
You should use trace to determine the proper BO being called during approval/rejection but I think the correct one is the LaborApproval BO, and the ApproveReject method.
There is an Approvedby but it is an External field and I was told I couldn’t use it in a BAQ. That’s where I started. If you create your BAQ and add LaborDtl, the Approvedby and PendingApprovalby are not fields in the table. When I called support they told me about the External field. I thought I had tried a pre-process on the BO.LaborApproval, but the UD fields still didn’t populate with any data. I’ll try again this morning.
Kathie,
Just to make sure I have this straight, you want to grab the Approver’s (or Rejector’s) name in the LaborDtl table whenever it is approved/rejected.
If that’s the case, and the approval happens at some FUTURE point to your operator entering their labor, then you need a trigger on the approval process to update the LaborDtl table.
I’m working in 10.1.600 at the moment, so if you’re on a different version, your mileage may vary, but the two options I see you having are a Data Directive on LaborDtl, triggering on when the “Approval Required” field changes from TRUE to FALSE, and at that point write the userid to your field (but there’s no indication there of Approved or Rejected).
If you hang a Method Directive on Erp.LaborApproval.ApproveReject or Erp.LaborApproval.Update, those will probably give you better information and then you’d need to connect back to the LaborDtl table and update your fields that way.
I created a pre-process method directive on the Erp.LaborApproval.ApproveRejectbut how do I connect back to the labordtl table to update the fields?
There is an “Approved By” field in the dataset for that BO, and it’s already working directly on the LaborDtl table, so you can use the “approved by” field as your condition (whenever it gets populated), and then use the Set Field setter to take that value and put it in your UD field.
So for your condition, select “the ttLaborDtl.ApprovedBy field of the changed row is not equal to the “” (meaning empty) expression”
And for the setter, "set the ttLaborDtl.[your UD field here] of the changed row to the [whatever value you want to store here] expression [ignore the with rule part].
There are other ways to do this, lots of people will use a condition of the field changing instead of a field value, but this is the way I do it.
As was mentioned previously, it’s also a good idea to test it by putting in message boxes that popup and let you know if things are happening.
Good luck!
Ernie, I followed your suggestions exactly and the field is still not populating. I’m not getting the message that I set up either. I’m not sure what else to do at this point, but it is surely getting very frustrating. Can you think of anything I might have missed?
If you’re not even getting a popup message, then the BPM isn’t firing. I don’t personally have experience with the LaborApproval.ApproveReject object. Did you find that in a trace? Just because a business object has a particular name (and that name DOES sound pretty enticing) doesn’t mean it works that way in YOUR process. If you haven’t used Tracing Options before (from Epicor’s classic main menu, drop down the Options menu and select Tracing Options, there are pretty good instructions in the help system), this would be a great opportunity to learn.
Another option would be to try a Data Directive BPM on the LaborDtl table, with a condition checking for LaborDtl.Approved value to be changed from “any” to “true”, and when that happens, use the setter to set your ud field.
I didn’t have much luck with the tracing options. I’ll try the Data Directive and see if that works. Thanks.
You cant go wrong with tracing. If you are getting too much unrelated stuff, I suggest clearing the log just before you execute the activity you want to trace. Every method the system calls will be logged so you will definitely get results.
Joining this thread a little late but can you not use SubmittedBy and TimeStatus to show this?
P.S.
Ref screen shots below for the method search and directive maintenance forms…
The directive messages pop up when I submit a record from the Time and Expense entry form.
If this isn’t the method you need… have you already run a trace and identified the appropriate method(s)?
Finally getting back to this. I’ve run the trace and it appears that I need the LaborApproval.ApproveReject to do this. The message I set pops up when I approve time in the Time and Expense Approval, but the UD field is still not being populated. I’m trying to get the person who approves the time entry, so I’m not sure that the SubmitforApproval will give me what I want.