Product Configurator and Discount Price Lists

Hi Ryan,

I have a similar setup with discounts being applied to various customers via the configurator and ran into a few issues trying to update the discount. You could go a few routes here, depending on what you think is best maintenance-wise for your situation.

First, you could create a BPM to call when the configuration DocRules update. I’d have to play with this a little to make sure I get the update rules correct, but if this is the route you want to go, I could show you how to do it.

A little bit easier (and cleaner IMO, since you’d still be controlling via configurator), you could create a method that looks up the discount % from PLPartBrk.DiscountPercent, then adds that to the existing OrderDtl.DiscountPercent.

The method would look like this:

decimal AddDiscRate = 0;

Erp.Tables.OrderDtl OrderDtl = (from Row in Db.OrderDtl where Row.Company == Context.CompanyID && Row.OrderNum == Context.OrderNumber && Row.OrderLine == Context.OrderLineNumber select Row).FirstOrDefault();

if (OrderDtl != null) {
	
	Erp.Tables.PLPartBrk PLPartBrk = (from Row in Db.PLPartBrk where Row.Company == Context.CompanyID && Row.ListCode == OrderDtl.DiscBreakListCode select Row).FirstOrDefault();

	if (PLPartBrk != null) AddDiscRate = PLPartBrk.DiscountPercent;
}

return AddDiscRate;

And then you could add the following to your OrderDtl Document Rules:

decimal oldRate = OrderDtl.DiscountPercent;
decimal newRate = oldRate + UDMethods.getAddDiscRate();

OrderDtl.DiscountPercent = newRate;

This should grab the existing discount (in your screenshots, the 18%), and add the discount rate from the Discount Price List on the Sales Order > Lines > Detail tab, as well as refreshing the price automatically.

1 Like