Skip to Content
author's profile photo Former Member
Former Member

Formatted Search and UDF

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'


declare @newcode as nvarchar(25)

set @newcode = U1

select @newcode


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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 02, 2005 at 03:13 PM


    AFAIK, Formatted Search can be used in 2 ways:

    1. To query values stored in DB. Is your Sales Order

    already saved when the query is performed?

    2. Also, one can query item/field values of the same

    form using the SELECT $[$14.1.0] -format.

    (Check F1 help or search this forum on this topic)

    However, the base form and the form that contains

    UDFs are separate forms (Sales Order = 139 and UDFs

    of Sales Order = -139 ). Therefore your (cross-form) FS doesn't work.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanx for input Juha.

      I have made a solve to the problem, and it works fine now.

      My FS is like:

      declare @newtaxcode as nvarchar(2)

      if (Select $[ORDR.U_avgkode]) = 'U0'


      set @newtaxcode = 'U0'

      select @newtaxcode


      I set this FS on my taxcode, and refered to my UDF when it changed. Works fine, but the screen is a bit flashy and "slow" when updating 50 order lines in a sales order.

      I am now able to update many lines in a matrix with a single select from a UDF.

      <u>Thanx to Ibai too, for helping me on track.</u>

      One issue that also was a key element is to refer to the defined values for the UDF.

      I had set like this:

      code description

      1 U0

      2 U1

      3 U2

      I changed this too

      code description

      U0 U0

      U1 U1

      U2 U2



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.