Select warehouse code from BP master record
I need some help with a IF statement
basically this is what i wnat to do.
I have created a field on the BP master data record to show the warehouse code which this BP is linked to.
When creating an invoice for items for this BP (where i have defined a warehouse on its master reocrd) i want the warehouse code to be selected from the BP master data record instead of the deafulted warehouse code that automatically come up when you select the item
Can some one help me with the If statement
IF IsNULL (Customer Whse) Read Item Whse
Else Read Customer Whse
SELECT IsNull(T0.U_WH,T1.DfltWH) FROM OCRD T0, OITM T1
WHERE T0.CardCode= $[$4.0.0\] AND T1.ItemCode = $[$38.1.0\]