Multiple Customer Bill to BPM to raise message

I am looking for a way to create a data directive or method in which a sales order is created, and a message pops up when there is more than one alternatve bill to available.

When a new sales order is created, the Bill To field is populated with a message “Same as Sold To” which is actually the OrderHed.CustNum. That message is the same whether there are alternative Bill To’s or not .

It’s hard for the user to know if a Bill To exists or not.

We are aware of the Default Bill To option on the customer record and we would be willing to use that in conjunction with the BPM.

Any suggestions on how to tackle this one?

In theory, I am thinking the logic should be if there are more than one alternate Bill To, then show the message.

I think using the Method that fires when you enter a customer number, you could do a post processing method directive. Then look at the Customer Record to see if there are multiple BillTos by referencing the CustBillTo table. If so, you could throw a message (or pass some info back to the form to highlight the field or something to that effect).

You might also try using a Row Rule to make the drop down a different color based on if there are alternate bill to’s.

1 Like

Row Rule - that’s a possibility - I went into customization and tried that, but it didn’t seem to do anything. this is what I did…

The field on the screen is bound to BTCustID

1 Like

For some reason, it is not saving my new row rule. That’s why it’s not working.

I click the disk icon to save

I save, get out and get back in… and it’s no longer there. Any idea or Epicor ticket?

You need to hit the Update Code button then hit the Save button.

1 Like

Thanks! I got it to update. Now, it is highlighting or each sales order, whether there is 1, 2 or more.

Is there a formula to reflect if there is more than one record?

I get the feeling that what I have is looking to see if the actual BTCustID has a value of 1 or greater in it.

1 Like

I think you need to do a little bit more to get what you’re after. My suspicion is that there is always going to be a value in the BTCustNum (or BTCustID) field. What you are going to need to do in the BPM that I mentioned above is lookup if there are multiple possible BTs using a query of the CustBillTo table where the CustNum = CustNum from the Order. Then set a callContextBpmData field like callContextBpmData.Checkbox01 to true if that condition is true. Then in your row rule, you will pick the callContextBpmData view and the CheckBox01 field and check to see if it’s true. Then have your row rule fire. Does that make sense? I’m not sure what the method is called but if you do a trace when you enter the Customer on an order, it will tell you the method to set your method directive on.

If you want the Message Box, hang a BPM off of

SalesOrder.ChangeCustomer Post-Processing, and do a query check in there for multiple bill to addresses in the table @dr_dan mentioned (CustBillTo?). Then pop up a message.

I like the row rule better myself, but it will require client code and might not translate well to the web.
(I’m pretty sure you can do it though)

1 Like

You could probably add a field to count the number of BT IDs in the dataset and then set your Row Rule to check that for greater than 1.

1 Like

I am understanding the concept of what you are saying but have to put that into practice. New to BPM but really wanting to learn this.

I like that you are suggesting it to work with the row rule.

I am making advances! I have it working one way, but not completely happy with the results yet. I think it might do for now, but will have to continue to make this work the right way.

On the customer record, I made one of the alternate Bill-To as the default. This way, when a sales order is created and the customer is pulled in, that Bill-To will be present. Because we are focusing on one customer right now, I can temporarily get away wtih hard-coding that BT Customer IN in - so that anytime that CUSTID pulls in, it will be highlighted yellow and of course, going to that BILL TO.

When the user changes it from that particular ID, then the highlight is taken off.

This is the code that is created:

	// Description: AltBillTo
	// **** begin autogenerated code ****
	RuleAction warningOrderHed_BTCustID = RuleAction.AddControlSettings(this.oTrans, "OrderHed.BTCustID", SettingStyle.Warning);
	RuleAction[] ruleActions = new RuleAction[] {
			warningOrderHed_BTCustID};
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleOrderHedCustomerBTNameEquals_ALLSTAR = new RowRule("OrderHed.BTCustID", RuleCondition.Equals, "1685", ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"])).AddRowRule(rrCreateRowRuleOrderHedCustomerBTNameEquals_1685);
	// **** end autogenerated code ****

Any further suggestions? I think the above may be a short-term solution.

For fun, I went ahead and decided to change the code so that if the BT Customer ID doesn’t match Customer ID, then add a warning. However, ONE ALTERNATE BILL-TO has to be selected on the customer record.

This way, no matter which customer is selected, as long as there is a default BILL-To, the row rule will kick in.

	// Description: AltBillTo
	// **** begin autogenerated code ****
	RuleAction warningOrderHed_BTCustID = RuleAction.AddControlSettings(this.oTrans, "OrderHed.BTCustID", SettingStyle.Warning);
	RuleAction[] ruleActions = new RuleAction[] {
			warningOrderHed_BTCustID};
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleOrderHedBTCustIDNotEqual = new RowRule("OrderHed.BTCustID", RuleCondition.NotEqual, "OrderHed.CustomerCustID", ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"])).AddRowRule(rrCreateRowRuleOrderHedBTCustIDNotEqual);
	// **** end autogenerated code ****