CustShip BPM Headache

  • 30 August 2019
  • 7 replies
  • 119 views

Hello,
I'm trying to create a BPM that will stop anyone that is trying to add a line to a pack slip that was imported by the DMT application. The pack slips (ShipHead) imported by DMT are identified by the EntryPerson field. It will look something like DMT<DateofSale> (DMT07312019 for example). So, essentially I want to throw an exception anytime anyone outside of a group "DMT" I created in Epicor tries to add a line to a pack slip with an EntryPerson that begins with "DMT". I have tried so many different options, I'm hoping to get your input.

I'm using the CustShip.GetNewOrdrShipDtl method for my testing. 

I created a BPM in which a condition checks that EntryPerson field to see if it begins with "DMT." If it doesn't, then who cares, continue. If it does start with DMT, it will then check in another condition if the user is part of the DMT access group. If they're not, then it will throw an exception. 

I'm using the "The specified field of all rows begins with "DMT" expression.

I've tried entering the entire EntryPerson field and making the condition equal that, I tried using a query condition, I tried pre, base, and post conditions and even data directives. I'm at a loss. 

Any idea how to get this working?

Thanks in advance!

------------------------------
Dusty Brossart
Senior Network and Systems Administrator
Appareo Systems
Fargo ND
701-356-2200
------------------------------

7 replies

Quote: I'm using the "The specified field of all rows begins with "DMT" expression.

Have you tried using the 'changed rows' option rather than 'all rows' ?

------------------------------
Drew Rust
Wipaire, Inc.
St. Paul MN
------------------------------
Yep, I've tried a combination of all options (changed, updated, added, etc).

------------------------------
Dusty Brossart
Senior Network and Systems Administrator
Appareo Systems
Fargo ND
701-356-2200
------------------------------
Are you certain that CustShip.GetNewOrdrShipDtl is the correct method?

The exception block is a useful tool for stepping through a BPM. I'd set it as the only block in the BPM and run your DMT. If the DMT returns the exception, then you
know you're working with the correct method. You can then add conditions one at a time to verify things are being processed as expected, conditions met, etc. and use your exception block to see how the BPM is being processed.

------------------------------
Drew Rust
Wipaire, Inc.
St. Paul MN
------------------------------
Try using the CustShip.Update method instead. Even though it is a new record I believe it still uses the update method to initially save the record. Post Processing directives are typically used with GetNew methods. If that doesn't work then try using a Data Directive BPM. 

Another tip is you can create a security group for DMT and put those DMT users in it and use that security group as a criteria in your BPM. 


------------------------------
Jeff Martinson
TEAM Industries
------------------------------
Using CustShip.Update actually worked. However, it allows the user to create the entire line before the error since it's triggered on the save/update method. 

I'm wanting to stop the line from initially being created at all, so they are stopped before even entering in any information.

I've tried both post processing and data directives with no luck. 

I am currently using the DMT security group to deny people, but it still needs the condition to check if the EntryPerson field starts with "DMT". Like I said, it works using the update method, but it requires the save button to be clicked so the user can enter all data first, which is a time loss for them.

------------------------------
Dusty Brossart
Senior Network and Systems Administrator
Appareo Systems
Fargo ND
701-356-2200
------------------------------
What I ended up doing was setting it up as a post-process on GetByID. It checks the EntryPerson for "begins with 'DMT'", displays a message saying that you need to have specific rights, and then will either load (if you're part of the DMT group) or it won't load if you aren't. I put the message in-between the conditions because the exception doesn't seem to display the warning message after the group check. Not sure what that's about, but this will work for now.

UPDATE: it seems even having it setup this way that the error message won't display at all if you aren't part of the DMT group. Even the message that's before the condition to check if you're in the group, which makes zero sense to me. At least it's stopping them, but it's a little odd that none of the messages are showing up if you don't pass the group condition. 

------------------------------
Dusty Brossart
Senior Network and Systems Administrator
Appareo Systems
Fargo ND
701-356-2200
------------------------------
You have a specific user/s setup for DMT, correct? And only those user/s are allowed to create a ShipHead record correct and they only going to be entering ShipHead record through DMT, correct?

If this is true then you can create a BPM Method Directive on CustShip.GetNewShipHead method... Then using Pre-Processing add the Condition "The method <is not called> by <specificed user>" (If you have multiple DMT users you can add multiple conditions setting or between them)... Then on the "True" side of the condition link the Raise Exception to prevent them from starting a new ShipHead record.

Or... if you have multiple DMT Users you can create a group like I said before and, instead of using the condition above, use the condition "The user who called the method <does not belong> to <DMT> group" and on the "True" of the condition link the Raise Exception.

I have attached these two above BPM examples... in the first example I'm using System Manager as the user, so if your user ID is not manager you cannot create a new ShipHead record. And in the second example I'm using the group ID of "DMT"... you'll need to add this group ID to your test system first before importing this BPM.

The problem with the way you were doing it before is you had the cart before the horse... You cannot have the BPM check the value in a field if it does not exist yet... When you are using a GetNew method it is in the process of creating the record and the field would not exist yet or have any values in it for the BPM to use a condition against when using Pre-Processing. This is why I said you typically use Post-Processing with GetNew methods.

Edit: I had my Trues and False mixed up for the links because I was testing both ways... all depends on how you set the condition first.

------------------------------
Jeff Martinson
TEAM Industries
------------------------------

Reply