Fomatted Search Error on AR Invoice
I'm having trouble with the following Formatted search:
SELECT T0.[SLPCODE], T0.[SLPNAME] FROM OSLP T0 WHERE $[$20.0.0] = -1 ORDER BY T0.[SLPNAME]
Any time I use the reference $[20.0.0] tot he Sales Person field instead of $[OINV.Slscode.0] it errors out. the formatted search is assigned to a UDF that allows the user to add a second sales person to the screen but I only want to let them do so if the Sales person assinged to the Invoice is "-No Sales Employee-", for which the Slscode is -1. In order to use the same formatted search on the Quote/Order/Invoice i need to referece the Sales person field by it's index.
Also, in my udf I would like to Store the code but display the name. Is there a way to do that?