I am trying to create a BPM that fires when a new operation is added to a job.
Apparently, the default Labor Entry method is “T,” and I have not found a way to change this outside of a BPM.
I want to set the default Labor Entry Method to “Q” for Quantity Only.
Trying to use a Data Directive on the JobOper table does not provide the option to “Set Field” (I would set the LaborEntryMethod field to “Q” instead of “T”
And using a Method Directive does not give me the condition for “There is at least one added row to the ttJobOper table” in the JobEntry - Add Operation method.
Does anyone know of another way that I could accomplish this?
I believe the order in which you are doing things will matter.
First major question is how are you creating the new record? You will want to set the field during that method. If you are using the GetNewJobOper (or something close to that), you will absolutely have the “There is at least one added row…”. You are likely using Pre-Processing and that would not make sense. If you use Pre-processing you are saying before the logic creates a row, do X. Well, if we don’t have a row yet, it wont have a way to set a field.
A Data Directive will only set the field when attempting to save to the database. You likely were doing a “Standard” Data Directive which will not allow you to make any changes to the record and therefore not have a “Set Field” widget.
I noticed that the “There is at least one added row” option is present if I do this on the GetNewJobOper method. I tried this originally as a post-processing (after a new JobOper record is created) but this didn’t work. When I added a new operation, the field was not set to “Q” as I was anticipating.
In Job Entry, I couldn’t find another way to get a new operation other than “Add Operation” so I took that with me and tried applying this logic to the AddOperation method. This is where I ran into this problem.
I would offer that you run a trace and (from the screen) create a new record, change the Value to “Q”, add the required values and save. This will tell you what has changed and what you can set as defaults.