We are using APR to send invoices and statements and for one of our customers, it’s sending to the wrong email address. I think the problem is in the RDD but don’t know how to solve it.
Customer-CustCnt relation has the following relationship fields:
Customer.Company = CustCnt.Company
Customer.CustNum = CustCnt.Custnum
Customer.PrimBCon = CustCnt.ConNum
The problem lies in the last piece. CustCnt.ConNum is not unique. It’s unique per ShipTo. If the ShipTo field is null, then the contact is associated with the customer. If the ShipTo field has a value in it, then the contact is associated with that ShipTo (and not necessarily directly with the customer).
So for this particular customer, there is a contact for ShipTo 12, which has a ConNum = 1 and there is actual billing contact which has a ConNum = 1, but nothing in the Ship To column. We want the invoice to go to the second guy, not the first, but the system is picking up the first (and only the first).
I can’t figure out how in the RDD to limit the contacts only to those associated with the customer and not with a ShipTo.
The To email is the email address of the primary billing contact. But I think the problem is that the wrong contact is getting associated with the records back in the RDD.
What you need is to restrict the CustCnt options to ones where (usually) ShipToNum is blank or empty string, or to be exact where ShipToNum equals the ShipToNum record on the Customer table, which is usually blank.
So if you add Customer.ShipToNum = CustCnt.ShipToNum it would normally sort the problem.
Thank you so much. That was the answer. I was trying to figure out how to restrict CustCnt options to where ShipToNum was null rather than setting it equal to the ShipToNum in the Customer record.
Glad it worked.
One word of warning, we have had unexpected things happen when people change the default ShipTo for some reason. I suspect the Epicor-preferred solution is a criteria on the CustCnt table within the RDD, which only needs to be ShipToNum is blank rather than null. But we can normally rely on the ShipToNum on the Customer table being blank unless someone has done something wrong, so that join works for us.
Excellent question Sam. Blank or empty usually means a string with nothing in it. “”
Null has special meaning for all types of variables and means unassigned. No value at all. It’s often represented by binary zeros. Sometimes when variables are created and are not assigned, they are null. (Depends on the computer language though). In Epicor, you might see the pop-up that says System.ArgumentNullException and that means that Epicor used a variable but expected a value to be there.