Skip to Content
0
Former Member
May 02, 2005 at 07:58 AM

Formatted Search and UDF

56 Views

Hi all,

I have an issue with a formatted search.

My intention is to update the field RDR1.vatgroup with a value set in a UDF on the sales order.

I have not been able to make it work, and If someone have a quick help idea it would be nice.

I have defined a userdefined field called u_avgcode. This is linked to some valied values for field like U1,U2,U3. The structure is 1=U1 and 2=U2 and so on.

<u>When I change a value here I would like to update the whole salesorder (all lines) with this value replacing the Tax code (RDR1.Vatgroup).</u>

The formatted search is like this on the RDR1.vatgroup:

if (Select $[$ORDR.U_avgcode]) = 'U1'

begin

declare @newcode as nvarchar(25)

set @newcode = U1

select @newcode

end

I have set 'Auto refresh' when the UDF field changes.

I can't make this work properly, any ideas..

I have also tried if (Select $[ORDR.U_avgcode]) = 'U1' with no luck.

regards

me