Issues with a BPM

That is how i have been testing opening an order and then closing it instantly. I guess there are some people that open orders and then close them without adding detail for whatever reason.

I am going to start this be saying this is VERY unconventional but it worked in our case. So early yesterday I realized there was 4 different ways of doing this.
1.) Parse out the change log and do reporting off of that. - seen this at another company and it was a HUGE pain.
2.) Write c# that will check to see if the record already exists. - We are trying to do as little code as possible to prep for kinetics. (easier transition)
3.) Create another unique identifier that would always create a new record in the table. I was going to do DateTime.Now.Seconds.ToString() but then you could have 20 records for one order.

Which brings me to what we did option 4.
Create new UD fields on OrderHed called OrderNum (string) and CustNum (string). The reason why we did this is because there was already established logs to this table long before our time. They are using 3 keys Key1 either OrderHed or JobHead, Key1 JobNum or OrderNum to String, Key3 CustNum to String. I came up with the idea to create the new fields because I wanted to do a condition in the BPM to check and see if there were any records in the UD table already. The problem is because it is BAQ light (as i call it) i had to match a string to a string to link the UD04 and ttOrderHed tables.

Below is a picture of how my query is setup.


image
image

I am now logging the ordernum and custnum (string values) to the orderhed table in this BPM as well.

Once again this is probably not the right answer for most but it was interesting and off the wall so I figured I would share.