Notification for High Value Shipment

bpm
shipping

(Emily Christy) #1

Hi, hoping somebody can help.

I’ve been asked to create an email alert when a customer shipment over a certain value is made.

I’m a bit of a BPM novice. I’ve created a post-processing directive using Erp.CustShip.InvoiceShipment to send an email. But I’m completely stumped as to how to add the criteria.

I thought to use the “Number of rows in the xxx query is not less than 1” condition, using the ShipOrd.ShippedAmt as criteria, but it doesn’t seem to be available to me.

Equally, I’ll need to pull fields such as Order Num and Customer Name into my email body. How do I make these available?

Or am I approaching this all wrong?

Any help will be greatly appreciated.

Thanks.


(Daryl Hewison) #2

We do this but when a high value order is taken. It’s a set of two data directives, one InTransaction to test for the conditions, and one Standard to actually do the sending. It tends to be easier to put your conditions in pre-processing. Our condition is just field value greater than, no need for a query.

Because we had people objecting to multiple sending whenever the order was adjusted we also added a UD field to flag when it had gone, but on shipments you can probably get away without that.


(Jason Woods) #3

Not sure if you need to sum the value of all the lines. This may be a small bit of code in your condition.


(Emily Christy) #4

Thanks both,

Turns out ShipOrd.ShippedAmt isn’t the criteria to use, as we don’t invoice until the following day and so far as I can see that’s when this table is populated.

So, I’ve spent the afternoon going round in circles to be honest.

I guess that I need to link ShipDtl back to OrderDtl to get the shipment value information. But it’s all a bit beyond me I’m afraid.


(Daryl Hewison) #5

How badly do you need this? Is it a case where you’ve gone back to the requester and said it isn’t worth the trouble, or do you need more pointers?


(Al) #6

i can provide you with some of my BPM examples to help on this if you want, you may need to be familiar with C# Custom codes


(James McKinnon) #7

If you go to company config | Modules | Materials | Shipping Receiving and check the calculate prices box, then the unit price and qty shipped * unit price for each relevant pack slip line will be stored in the shipdtl table - they will also appear on the pack slip so you may want to edit the pack slip to hide these on the printed output.

If you turn this option on you should be able to reference them in a bpm - not quite sure how exactly you would go about calculating the sum

If this works for you then I would use it as it is using core system functionality to do the calculations.


(Daryl Hewison) #8

That’s an excellent suggestion, clean and simple.

If for whatever reason it isn’t an option, then you can create a BPM variable of decimal type, and populate it with a “Set Argument/Variable” widget, expression something like

(decimal?)(from drow in Db.ShipDtl
join hrow in (from row in Db.ShipHead where row.PackNum == ttShipHeadRow.PackNum select row) on drow.PackNum equals hrow.PackNum
join orow in Db.OrderDtl on new {drow.OrderNum, drow.OrderLine} equals new {orow.OrderNum, orow.OrderLine}
select ((orow.ExtPriceDtl / orow.OrderQty) * (drow.OurInventoryShipQty + drow.OurJobShipQty))).Sum() ?? 0.0m

You need a conditional before it to make sure the right things have changed in ttShipHead, for example that the shipment has been shipped, but then another condition after this one can check its value as needed. And obviously it isn’t using the full system logic to arrive at the value, either, but it should be possible to tweak it to get close enough for the purpose.

Definitely see if the configuration option will work first, though.


(Al) #9

one way to calculate any sum is a foreach loop within the target table and this simple equation using relevant variable type
sum =sum + table.row value


(Emily Christy) #10

Thanks for your help, all.
I only work part time (hence the delay in responding) and this isn’t my main priority right now - I’m kind of working on it as and when. You’ve given me great pointers though to be starting with. I’m sure I’ll be back when I still can’t figure it out. :slight_smile:

Thanks again