Formatted searches and SQL functions

Hi,
I have made test to call a SQL function in a formatted search. It seems to be impossible?
Is it right or not ?
Thanks for your help.

You don't need to put a semicolumn, and don't have to put quote's around sbo variables (from a form)...
<b>Example</b>[code]SELECT ItemCode, ItemName FROM OITM WHERE WhsCode = $[$38.1.0] AND SellItem = 'Y' AND OnHand > 0[/code]
Hope it helps...

Similar Messages

  • Formatted Search and Item Events

    Hi,
      I am having a huge problem with using Formatted Search and Add-Ons.
    On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes.  This is the only Formatted search on this form and it works fine.
    However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times.  I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
    If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
    I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on.  Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True. 
    Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
    Thanks for Any Help
    Paul

    Hi Alfredo,
      Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions.  Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything.  I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
    Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On. 
    Thanks Again,
    Paul

  • Joker characters in the search and replace function

    Hello everyone,
    Just a quick question :
    I was wondering what character can be used as a joker character in the search and replace function (I did a research in the site, but didn't find any thread)
    To be clear, I have misspelled a word, for example «trouser».
    I know I didn't make any mistake with the first and last letter, but sometimes I wrote it «tourser», «turoser»
    (sorry if there is a weird meaning, i'm french, and for me it won't mean anything, so don't take it personally)
    I would like to be able te replace all the versions of «trouser», even the good ones, using «t*****r» in the search and replace function.
    I tried the «*» character, but it's not the jocker.
    Thank you for your help !

    As I can't edit my first message, just wanted to let you know it's also called «wildcard» characters
    Like here (Careful, it's… Ms Office)

  • Search and index functions don't work with merged projects

    Until this morning, the search and index functions in my RoboHelp project worked okay; I have one Main project into which I have merged more than three dozen sub-projects.  About an hour ago, I created a new sub-project and merged it into the Main project; now, it's as if the topics in my merged projects don't exist.
    Any suggestions?
    thanks,
    Lon

    So when you open the merge you see all the content, it is just the search and index not working. This must be merged CHMs as you are talking about a Favourites tab so maybe your other comment is relevant. My understanding of merged CHMs is that you do not want spaces in file names, that could be the problem.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Formatted Search and "copy To" Function

    I have created a Formatted Search on the document field series (delivery) that picks up the country from BP and sets the right series. This all works fine but something else is also happening:
    When I use the "copy To" Function in the base document (order) the formatted Search in the target document (delivery) will not be executed and therefore the series will not be set correctly. Is this a bug? Exists a workarraound?
    I use the version 2007 PL08.
    Thanks for your help
    Gert

    I still think it's a bug/flaw. We got the run around from support with suggestions to trigger on some other field like the suggestions above. I'm working on a client on 2005a SP01 PL42 and I've seen the issue even earlier than this patch. We ended up handling this as part of a small add-on because this functionality had to work reliably and we could not depend on the users to always use the Copy From. Plus, you can save a lot of time by having an alert with let's say orders that are ready to be delivered or invoiced, and all the user has to do is drill into the alert to open the order and copy to invoice, rather than figuring out the customer code on the invoice to use the copy from button.
    You could open a ticket... maybe you'll have better luck. I still think this functionality should be consistent on either direction of the flow.
    Liviu

  • Issue with Formatted Search and Sales BOM

    Good afternoon,
    One of our customers uses a Formatted Search on the Sales Order row to lookup the Project Code stored against the Item.
    This works very well, except for when a Sales BOM is selected.  I assume the FS lookup is working correctly, but the screen is quickly refreshed to list all the component items related to the BOM.  This process appears to overwrite the contents of the Project field.
    We wish to keep this functionality, but retain the FS lookup results in the Project column.  Could the order of the process be changed so that the BOM refresh occurs prior to the FS lookup.
    Thanks
    Greig
    Edited by: Greig Burrows on Jul 21, 2010 5:57 PM

    Hi,
    For metadata, which metadata are you not seeing? Are they custom properties within the PDF, and have you checked if you have crawled properties matching these?
    I know there's issue with last modified on PDF's (http://sharepointfieldnotes.blogspot.no/2013/05/understanding-and-getting-sharepoint.html) 
    Thanks,
    Mikael Svenson
    Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • 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'
    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

    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'
    begin
    set @newtaxcode = 'U0'
    select @newtaxcode
    end
    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
    regards
    me

  • How to get currency format using pl sql function

    Hi all,
    I am a newbee on the forum. currently i am facing an issue with the Format of Currency in an rdf report. This is a field of tax amount & i need to make some conditional formatting on this like if the tax amount is Zero then some static note is to be added before this field.
    I have tried a lot of functions on it like the one as below:
    IF :cp_org_id = 102
    AND :invoice_currency_code <> 'CAD'
    AND TO_CHAR (NVL (:cf_tax_amount, 0)) = 0
    THEN
    RETURN (TRUE);
    ELSE
    RETURN (FALSE);
    This is working fine in case of Zero tax amount But gets error out when there some Tax amount exists. It gives a VALUE ERROR in this format Trigger.
    Kindly suggest me how to solve this issue with right function. If possible then write the pseudo Code also.
    Thanks in advance
    D_Verma

    In addition to Satyaki:
    It might be a 'Reports Thing'.
    It works in SQL*Plus (although relying on implicit conversions is a bad idea, as mentioned):
    MHO%xe> begin
      2  IF 102 = 102
      3  AND 'DAC' != 'CAD'
      4  AND TO_CHAR (NVL (null, 0)) = 0
      5  THEN
      6  dbms_output.put_line('TRUE');
      7  ELSE
      8  dbms_output.put_line('FALSE');
      9  end if;
    10  end;
    11  /
    TRUE
    PL/SQL-procedure is geslaagd.
    MHO%xe> begin
      2  IF 102 = 102
      3  AND 'DAC' != 'CAD'
      4  AND TO_CHAR (NVL (0, 0)) = 0
      5  THEN
      6  dbms_output.put_line('TRUE');
      7  ELSE
      8  dbms_output.put_line('FALSE');
      9  end if;
    10  end;
    11  /
    TRUE
    PL/SQL-procedure is geslaagd.
    MHO%xe> begin
      2  IF 102 = 102
      3  AND 'DAC' != 'CAD'
      4  AND TO_CHAR (NVL ('0', '0')) = '0'
      5  THEN
      6  dbms_output.put_line('TRUE');
      7  ELSE
      8  dbms_output.put_line('FALSE');
      9  end if;
    10  end;
    11  /
    TRUE
    PL/SQL-procedure is geslaagd.

  • E-commerce - search and compatibility functions

    I'm very new to BC, and trying to create a BC website for a client selling printer toners and cartridges.
    I would like to know which BC functions I would need to use in order to create the following 3 functions:
    1. The ability to search for compatible products via a search form, such as the following link. https://www.cartridgeworld.com/main/
         > I know you can create these forms with Web Apps, however the products need to be e-commrce products as opposed to Web App items. Would I need to integrate the two?
    2. How to create a printer compatibility list by the individual product page, as by the following link. https://www.cartridgeworld.com/product/details/1315.10678-e-erc38krbn/
    3. How to create search filters such as on the left sidebar of the following link: https://www.cartridgeworld.com/product/
    Additional Questions:
    >> Is there a way to add more classification fields in the product details page? And or change the default field label names?
    >> Aside for classifying products through catalogs, is there a way of adding an additional way to sort and classify the products. For example; Under categories I would have the different product companies, however I would also want to classify them as toners or cartridges...
    Thank you!

    When candidate register themselves in Recruiting application, they have two option to set their profile status i.e. 'Locked' and 'Released'.
    Locked - Applicant is inactive or not looking for change. So when recruiter do a search, they won't see 'Locked' profiles.
    Released - Applicant is active or looking for change. So when recruiter do a search, they will see 'Released' profiles.
    ...Naddy

  • Help creating search and results function for my site. Please help!

    Hi guys,
    I'm making an eCommerce/PayPal website for some products I'm selling. The website is currently built with PHP and HTML.
    I want to add a search box so people can search for what the specifically want - then the results page will display a list of the products with links to the products' individual pages.
    From what I understand this will almost certainly need to be database driven. My only problem is that I barely know where to start.
    I've created a database on my host and have created dummy pages of how I want everything to look.
    Each product will need 3-5 search terms attached to them.
    Can someone please tell me where to begin and how difficult what I want to achieve will be?
    Thank you and I hope to hear from you.
    SM

    The solution is database-driven only if the information about your products is in a database.
    There are two approaches for a mySQL database, using the LIKE query and using MATCH AGAINST. These are SQL, not PHP, but the search results are processed by PHP.
    There are plenty of tutorials on the web for these two methods. I prefer MATCH AGAINST, but it is a little bit more involved than LIKE.

  • Search and autotune functionality

    I had DirecTV and could not bring it with me.  There was certain functionalities that DirecTV offered that seem to be missing with Xfinity and I find Xfinity to be very basic and not very good. Am I missing something?Favorite - I chose favorite channels, but cannot lock that list as the primary list and constantly have to change to my favorite list.  Why, if I chose that, is it not the primary list?I put a channel on the favorite list and find it shows both the non-HD and HD channels for that channel.  I 'unfavorite' one of the channels from the list and BOTH channels are removed.  Huh?Why can I not have more than one favorite list?  I used to have a list for kids shows along with my favorite list.Searching is very basic.  Why do I have to retype a search everytime I want to see if another program is now on the schedule?  The search seems to only look at the titles and not at the descriptions.  DirecTV's whole search functionality is much better.After searching for a program and finding one I want to see which may be three or four days in the future, why can I not set it to be autotuned?  I want to watch it.  Now I write it down on a piece of paper.  Check the 'autotune' functionality with DirecTV.  Much better than Xfinity.

    Thank you for your reply.  How did you set up more than one favorite list?  Do you mean you go to the first list of guides (full, HD, favorites, sports, kids) and then, say, select 'Kids' and go through the process of selecting favorites from that list?  As for it saving the last one I choose, no, it doesn't.  I may be in my favorites list and do a 'last' going to another channel on my favorites list and then hit 'Guide' and all channels will come up. Sometimes I go to the Guide and the cursor will just roll over all the icons.  This will happen when I do 'Last' also. Called Comcast about the last issue and the 'agent' said it was a new system (only 1-1/2 years old) and so still had some problems.  I write computer software.  I'd get fired if I produced AND installed such rubbish.  Am not impressed with Comcast's functionality. 

  • Simple formatted search

    Hi,
    I'm trying to learn how to use formatted searches and SQL in SAP Business One. Can anyone give me some simple examples to start with?
    For example, on AR Invoice, if customer (OINV cardcode) is X, a UDF field should be populated 'Y". If customer (OINV cardcode) is not X, UDF field should be populated 'N'.
    Can you provide me the SQL code for the query to be used in the formatted search? Just looking for some examples to get started.
    thanks

    Thanks Gordon, that worked!
    How do you know that $[$4.0.0] is OINV,cardcode(BP name on AR invoice)?
    For example, if I want to use a different field intead (like Item No.) how do I know the paramater/variable to sue?
    I guess $[   ]  means a user input paramater(not yet saved to database)?

  • Problem with activation of Formatted Searches

    There seems to be an error in the activation of formatted searches in SAP B1.
    The following is an example to demonstrate the real situation with a minimum of complexity.
    1. We have defined 2 user defined fields, U_trigger and U_target, in the title area of documents. Both are defined as alphanumeric fields with standard length 10 and some predefined values.
    2. For sales orders we have defined for UDF 'target' that a formatted search 'getTriggerValue' is activated on changes of UDF 'trigger'.
    3. The formatted search 'getTriggerValue' reads the value of UDF 'trigger' and writes it to UDF 'target':
    DECLARE @triggerValue AS nvarchar(10)
    SET @triggerValue = $[ORDR.U_trigger]
    SELECT @triggerValue
    When we add a new document to the database, i.e. the document is in "button-mode" = 'add', there are no problems with the activation of the FS on field 'target' when the value of field 'trigger' is changed!
    After a document is already written to the database and is later displayed on the screen again, the document is in "button-mode" = 'OK'. In this situation the FS on field 'target' IS NOT ACTIVATED when the value of field 'trigger' is changed, i.e. the value of 'trigger' is not copied to 'target'.
    After this first change the document is now in "button-mode" = 'update'. If we now change the value of field 'trigger' a second time the FS on field 'target' is activated an the value is copied from 'trigger' to 'target'.
    If we define the FS of field 'target' with option 'Refresh Regularly' the FS is activated after the first change of field 'trigger' as expected.
    But we CAN NOT USE THIS OPTION AS A STANDARD SOLUTION for our problem, since some fields and their FS can not work with this option and need the standard option 'Display Saved Values' set. Otherwise some fields yield wrong values, since they are working not only with constant predefined values as in the simple example above, but with dates which are set by GETDATE() in the FS, e.g.
    Is this behaviour a bug of SAP (FS is not activated even if the value of the refresh field is changed)?
    If not, what is the idea behind this behaviour?
    And how can I get around this behaviour?
    Thank you for your support!
    Frank Romeni

    Hello Suda!
    Many thanks for your answer!
    Perhaps my explanations are a bit in confusion.
    The example in my question is just to demonstrate the behaviour of the formatted search with option 'Display Saved Values' set, i.e. in a document that is already saved to the database, only after the second change the formatted search is activated.
    I am aware that with the simple formatted search that I have shown as an example everything works fine with the option 'Refresh Regularly'.
    But what is the meaning to activate the formatted search only after the second change when option 'Display Saved Values' is set?
    The reason why we can't use option 'Refresh Regularly' is that in our real application not only constant values are copied from 'trigger' to 'target'.
    Let me give you an example which approaches the real situation more than the first example:
    DECLARE @trigger AS nvarchar(20)
    SET @trigger = $[ORDR.U_trigger]  -- U_trigger / UDF 'trigger'
    DECLARE @save AS datetime
    SET @save = $[ORDR.U_date]        -- U_date / UDF 'date'; save current date
    IF @trigger = 'getDate'
      SELECT GETDATE()
    ELSE IF @trigger = 'getDateConst'
      SELECT '01.01.2008'
    ELSE IF ...
    ELSE
      SELECT @save                    -- no value in @trigger to change date ==> reset
    Option 'Display Saved Values' set: formatted search is activated only after the second change of value of UDF 'trigger'. This is not acceptable!
    Option 'Refresh Regularly' set: Suppose the 'trigger' is set to 'getDate'. The actual date, e.g. 25.06.08, is displayed in UDF 'date'. The document is saved to database. When the document is fetched again on the next day, the formatted search is activated immediately without the change of any values, i.e. 'trigger' still is set to 'getDate'. This is evaluated in the formatted search and the function GETDATE() is called and the now actual date, 26.06.08, is written to UDF 'date'. This is wrong!
    I hope that the new example shows why we can't use option 'Refresh Regularly'!
    We need no regularly refreshed value of UDF 'date', we need an activation of the formatted search only when the value of UDF 'trigger' changes. But why is it activated only after the second change when 'Display Saved Values' is set?
    Thank you for further support!
    Frank Romeni

  • Retrieving the value using formatted search

    Hi everyone. I have a question regarding on how I can get the value of the user-defined field in the title of a marketing document. I would like to get the value using formatted search and sql query.
    Here's the format I am currently using.
    $[$ <Item>.<Pane>.<Variable>]
    Is my format correct? Thanks.
    Regards,
    Omann

    Hi Omann,
    You can refer to fields in an entry screen using the syntax
    $[Table name.Field name]
    The table name is the name of the table belonging to the entry screen, for example, OINV for the A/R invoice entry screen.
    You can also use the fieldu2019s item number and fieldu2019s column number to refer to a field on the entry screen. By doing this, the query applies to all document entry screens. The syntax is then
    $[$Fieldu2019s item number.Fieldu2019s column number.NUMBER/CURRENCY/DATE/0]
    The system is able to uniquely identify each field of a document using the fieldu2019s index number and fieldu2019s column number. If you have activated the debug information under View  Debug Information, the system displays the fieldu2019s item number and the fieldu2019s column number in the status bar.
    You use the NUMBER parameter if the field concerned contains an amount and a currency key, and you want to extract the amount only. 
    You use the CURRENCY parameter if the field concerned contains an amount and a currency key, and you want to extract only the currency key.
    You use the DATE parameter if the field concerned is a date field and you want to use it for calculations.
    Regards, Yatsea

  • How to get numeric result from 'search and replace' string function

    hii
    i am using search and replace function to get output.my output is of form ' *X0123.3 ' .here i am replacing the term *X01 with space because i need only 23.3 as a result.but i am unable to get that out in the output indicator.i used lot of functions like string to number and so on but i am getting output as zero .can you please suggest me wt to do.i am attaching a copy of my file.
    Attachments:
    Untitled 1.vi ‏25 KB

    Your problem is the fact that you are converting it to an integer, thus loosing the fractional part. You need to use "Fract/Exp String To Number" instead and create a DBL so yor data is 23.3 instead of 23.
    You also don't need to manipulate the string if the initial part is of constant lenght. Just use the offset input as in the figure below.
    Message Edited by altenbach on 07-31-2006 07:02 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ToDBL.png ‏2 KB

Maybe you are looking for