Example Video: Using BPMs to Default Values on a new part

In this video I use BPMs to set some default values on a new part in Epicor. Using both Method Directives and Data Directives I default parts per container, backflush and primary bin.

The question was posted on the EUG form, but since I made the video I thought I would post it here too.

7 Likes

Winner!

So you do that in a Data Directive? Why not Method Directive’s GetNew… Data Directives are not the place for that, according to Epicor. Mind I only skimmed the video. Maybe you explained it :slight_smile:

image

Method Directives:

  • Pre, Post and Base processing logic
  • Access to BOs
  • Ideal place for Validations / Exceptions / Data Changes

In-Tran:

  • Executes after standard Entity Framework data triggers
  • Executes within a transaction, as a part of the trigger pipeline
  • Immediately processes affected row
  • Processes one row at a time (two rows for update operation (RowMod = “” is old row)
  • Can change data on save
  • — The In-Tran should never if it can throw an exception, it is very very expensive rollback.
  • You shouldnt access BOs in here!

Standard:

  • Executes when service method call has completed
  • Executes only if service method completes without exception
  • Processes batch of affected rows at once
  • Does not affect data save
  • Ideal place for integration operations (Audits, Email, Logging, Notifications, API)
1 Like

I tried to explain in the video… :slight_smile:
Defaulting the part values are done in the method directive. The PartPlant and PlantWhse records don’t exist until the part record is saved the first time so there isn’t anything to update. It could be done using only method directives with a post process on Update looking to see if a new record was created then modifying the data and doing second update.

2 Likes

I am blind :slight_smile: I saw you did Method Directive in the beginning. Apologizes… I know a guy that lives in Data Directive’s because of what he learned on the EUG years ago in E9… he doesn’t know it yet… but once we start running MRP and stuff – it will all surface :smiley: and he will lose 10yrs of his life debugging like I have :smiley:

1 Like

Some of the PartPlant fields would normally be dangerous modify in a data directive. A bunch of them reset the MRP recalc needed flag. I should have emphasized that…

2 Likes

I need to stop skipping the first 3min of a video… I am so used here comes the “this video is sponsored by Applebee’s, get your margaritas on…”