So our Sales orders will sometimes have a different Ship To Customer than the Bill To Customer, and some Sales orders will have a ShipTo record for the Ship To Customer:
I just remembered, you have to account for using the blank ship to record on both tables. I forget how to code this right now, but I will look it up as I believe I have it noted somewhere.
I noticed an odd thing. In my formula, “… == ttOrderHedRow.ShipToNum…” that the ShipToNum was pink and not black like the other fields.
I was grabbing the value from here:
But because I had a variable with the name ShipToNum, Epicor thought I was referencing the variable and not the tt value.
So I changed my variable name from ShipToNum to Ship2Num and it changed the values in this formula:
I had to do the same thing with CustNum (another variable I created).
Now the formula looks like this:
But still no joy yet.
Yup, select them all to see all of the data and how many records are returned. I have found many times that the tt table does not actually contain the info I am looking for. Or that I am returning more than 1 row.
ADVICE: DO NOT CREATE VARIABLES WITH THE SAME NAME AS FIELDS
Success!!! Once I changed my variables (so the variable name did not match a field name), I forgot to change the Scalar variable to match my new variable name. Now that I have fixed all my variable names, I get the value I am looking for.
I’m sorry, I was unclear on if it was being used in a custom code block, or an expression.
It would have required some tweaking to be used in an expression.