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

Formatted Search Problem

Hi All,

SAP Business One 2007 A SP01 PL05

I am having a small problem with a formatted search that is not displaying the correct values on only some items.

I have created a UDF with valid values of F, R, and O and it is called Division. All my item codes are 7 digits long for example B123ABC. I have also created profit centers as follows B123ABCF and B123ABCR.

My formatted search is on the profit center field and it is set to auto refresh when exiting altered column Division and display saved user defined values. The query is

SELECT $[$38.1] + $[$38.U_Division]

and that should select the itemcode and the division value and insert it into the profit center field which will select the correct profit center.

This works but there are a few items where it does not work for argument sakes if I select item B123ABC and my Division is R it gives me B123ABCF in the profit center and I cannot workout why this is.

I have removed the item and added it again, changed the formatted search to update on a different column but it has not worked.

Any suggestions on how I can get this to work correctly?

Regards,

Quinn

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 28, 2010 at 12:26 PM

    Are you sure the code of the UDF is u2018Ru2019 and not only its description?

    You can try to execute the FMS code so that you can see the replaced values:

    1. Go to the document with the problematic item and R divison.

    2. Activate the FMS query with the mouse from the top menu Tools / Queries / User queries selecting it.

    3. Then a window will open showing the query with the substituted values and you can see what causes the problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2010 at 11:11 AM

    Hi Quinn,

    Try this,

    DECLARE @a nvarchar (10)
    SET @a= $[$38.1.0]
    SELECT @a+(SELECT $[$38.U_Division])
    

    OR

    SELECT $[$38.1.0]+$[$38.U_Division]
    

    Regards,

    Madhan.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Perhaps a bit more information might help.

      The exact itemcodes that I am having problems with are B162ADU and B207ABF

      When in the profit center column if I click on the magnifying glass I get B162ADU with a space after the U so that leads me to believe that the formatted search is not working correctly.

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.