Set UD Field


(Kathie Gilchrist) #1

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?

(Bruce Ordway) #2

Just wondering if you are using Erp.Labor.SubmitForApproval?
And have already tried adding messages to pre and post method directives?

(Ken Brunelli) #3

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 ).

(Kathie Gilchrist) #4

I don’t see Erp.Labor.SubmitForApproval, but I am using LaborApproval. I did not add any messages so I will try that. Thanks.

(Pierre Hogue) #5

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…


(Dave Moon) #6

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
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

(Kathie Gilchrist) #7

Not sure what you mean by using the pre process to set the call context field. Am I saving the call context field somewhere?

(Bruce Ordway) #8

I think there are more than 100 methods for Labor
Maybe can try changing your search options or specify “start at” SubMitForApproval

I did a quick test & both pre/post directive messages did pop up when I submitted from Time and Expense entry.

(Chris Conn) #9

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.

(Kathie Gilchrist) #10

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.

(Ernie Lowell) #11


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.

(Kathie Gilchrist) #12

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?

(Ernie Lowell) #13

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!

(Kathie Gilchrist) #14

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?

(Ernie Lowell) #15

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.

(Kathie Gilchrist) #16

I didn’t have much luck with the tracing options. I’ll try the Data Directive and see if that works. Thanks.

(Chris Conn) #17

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.

(Dan Edwards) #18

Joining this thread a little late but can you not use SubmittedBy and TimeStatus to show this?

(Bruce Ordway) #19

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)?

(Kathie Gilchrist) #20

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.