Formatted Search Document Numbering

Dear Experts,
I am trying to place a formatted search in the document number series of PO to change it to a particular numbering series whenever the supplier code starts with '0'.
This is the query i have tried.
SELECT CASE WHEN T0.[CardCode] Like '0%%'  THEN 'Comms'
It just seems to come back with an internal error, is this possilbe? if so how?

Hi,
Please check this :
SELECT CASE WHEN T0.CardCode Like '0%%' THEN 'Comms' END FROM Table Name
Table Name =  from where the cardcode field is selected.
Kind Regards,
Jitin
SAP Business One Forum Team

Similar Messages

  • Formatted Search Numbering Wildcards

    I've seen lots of numbers used in formatted search queries on these forums, and it looks like they are used as wildcards (as mentioned below) so that a single query can be used for all marketing documents for instance.  Is there a list somewhere that shows which numbers correspond to which tables and fields?
    "Note!!! You can replace the $[ORDR.CARDCODE] string (in the query) with the $[$-4.0.0] string, and the $[ORDR.NUMATCARD] string with $[$-14.0.0] string. Using these alternative strings will enable SAP Business One users to activate this query in other marketing documents, by changing only the name of the related table."
    My specific question involves a UDF.  I have a row level UDF in my marketing documents called "OrderType", which lets us specify if it is a Normal order, Sample order or a Service order.  Depending on which is selected, my formatted search automatically changes the G/L Account field and COGS Account field on the same row.  Can I use a single query for all marketing documents instead of having one for each table?  Below is my query that is currently functional for sales orders.
    SELECT
      CASE $[RDR1.U_OrderType]
        WHEN 'Normal' THEN 5000
        WHEN 'Sample' THEN 6125
        WHEN 'Service' THEN 5803
      END $[RDR1.U_OrderType]
    FROM RDR1 FOR BROWSE

    As long as you do not include any table names in your query, it applies to all your marketing documnets.  You can find this info by View - System Information.
    Actually, you should create another UDF in the item master. The UDF in all your Marketing Row levels will get this info.
    Your query will looks like:
    SELECT
      CASE $[$38.U_OrderType.0]
        WHEN 'Normal' THEN 5000
        WHEN 'Sample' THEN 6125
        WHEN 'Service' THEN 5803
      END

  • Problem when create auto numbering in BP master using Formatted Search

    Hi all,
    I have a problem in creating auto numbering in BP for Customer type using Formatted search
    My query is like this
    declare @tempNo as char(20)
    set @tempNo=(select  Isnull(max(REPLACE(OCRD.CardCode , LEFT(OCRD.CardCode,10),'')),0)  + 1
    from OCRD where (CardType ='C') and LEFT(OCRD.CardCode,3) = 'CU.' )
    set @tempNo='CU.'left(convert(varchar,GETDATE(),112),6)'.'+@tempNo
    select cast(@tempNo as char(20))
    It should be creating the new number for example
    CU.201101.1
    CU.201102.2
    CU.201103.3
    CU.201103.4
    The format will be like this CU.YYYYMM.autonumbering
    So if the current year is still the same it will always increase the number and it will reset the number become 1 if the current year is change.
    But when i execute the number , the number doesn't increase, still generate the last number CU.201103.4
    I have use this query in generate item number, it runs well but different format.
    Is there some thing wrong with my query?
    Thanks in advance
    Regards
    Jia shun

    Hi Jia shun,
    You have posted an identical threads. There is no such need. Please close this one and response to the one with answer already.
    Thanks,
    Gordon

  • Formatted search to update item description in Purchase order document

    Hello Everyone,
       Has anyone developed a formated search to update the item description field on the PO or SO document?  I need to change the  standard Item Description  based on the BP catalog number but cannot seem to get it to work.  I know to change it using the screens you need to enter CTRL+TAB to move from the field without triggering a lookup process but do not know how to do this in a formatted search.  Has anyone tried this?

    Hi,
    You may check this :
    BP Catalog Number in 8.8
    Thanks,
    Joseph

  • Document Numbering Formats for Extended Fields

    Hi, experts.
         I want to create a document numbering formats for my extended fields.
         1) I want to add my document numbering format to Fine Tune Activity.
              2) I want something like this. But I want to add more fields to the following screen like a prefix and some other validations.
              3) I want to use that numbering formats for my extended fields.
                 Are those possible?
      Regards,
      Fred.

    Hi, Horst.
         Thanks,
         I read your docu. And tested the new feature.That's great.
         That is really a reasonable way to create number ranges.
         But here, what I want is to get a "numbering format" feature for my extension fields like the way I explained above.
    Regards,
    Fred.

  • Extra Discount in Marketing Documents - Formatted Search

    Hello All,
    I am trying to add a UDF for "Extra Discount" in the marketing documents. I have tried to attach a formatted search on the document total to calculate the final value after this extra discount has been specified. However, the formatted search doesnt work and I get an "Internal Error".
    The scenario mentioned underneath will explain the requirement:
    <b>Default Option in SAP:</b>
    Customer                               C0001
    Item        |       Price     |        Discount       |      Tax      |     Total
    I0001      |       100         |        10%           |       VAT@4   |   90
    Total                                    90
    Discount                     5%    4.5
    Tax Amount                         3.42
    Doc Total                             88.92 
    <b>Requirement:</b>
    Customer                               C0001
    Item        |       Price    |         Discount     |        Tax        |   Total
    I0001       |      100      |           10%           |       VAT@4  |    90
    Total                                    90
    Discount                     5%    4.5
    <u>Extra Discount            2%    1.8</u>
    <b>Tax Amount                         3.348
    Doc Total                             87.048</b>
    Is it possible to have this scenario mapped in SAP Business One using formatted search without using SDK/Customization?
    Regards,
    Gyanesh Rupani

    Hello Jimmy,
    The client wants the extra cash discount to be visible on the invoice itself. I have tried creating the UDFs and assigned appropriate FS to them to change the document total. However, the issue is that the moment the document total is affected, the discount (available by default in marketing documents footer) automatically gets changed proportionally!
    So, for eg. if an invoice is for 1000 USD and I give a discount (system field) of <b>10%</b> to a customer and 5% as cash discount (UDF), with the help of FS, the invoice amt automatically gets changed to 850 USD but the discount field also automatically gets changed to <b>15%</b>!
    This is the inbuilt functionality of SBO - so if someone can help me overcome this, I will be very grateful.
    Regards,
    Gyanesh

  • Formatted search Auto update based on copy to next document

    Hi all,
    I have a formatted search on Sales Order. I want this formatted search to update/trigger when a Sales Quotation is copied to a Sales Order. Is this possible. I tried using Sales order document number but under auto refresh when field change but didn't work. Looks like it's not possible to trigger a FS simple by opening a new document creation screen. In this scenario using sales order due date is not ideal.
    Thanks all

    Hi Nagarajan,
    I don't think the code of the FS matter. Its about whether a FS can be triggered without doing anything more once a quotation is copied to sales order.
    Thanks

  • Formatted Search - Using field index to refer to UDF in many documents

    I have some UDFs in my marketing documents - say U_VALUE
    I want to write a fairly complicated formatted search and use it for the same thing across all my marketing documents.
    I don't want to use
    $[ORDR.U_VALUE]
    in my formatted search as this will only work in the sales order document.
    I want to use something like
    $[$4.0.0]
    which brings back the cardcode independant of the form we are looking at. However
    $[$U_VALUE.0.0]
    will not work!
    Hoping someone can help!
    Edited by: Daniel Abbatt on Apr 10, 2008 6:16 PM

    Yes you would have to have a UDF called VALUE on the marketing document for this example to run and even then it will error!
    That's the point, the code above will not work, SBO only seems to be able to know about ORDR in a sales order and OINV in an invoice. So if I am in a sales order, it errors on the reference to OINV, even though the code that uses the
    $[OINV.U_VALUE]
    is never actually accessed by the SQL. I guess this is because SBO does the substitutions before it executes the code.
    All I am basically trying to do is create a generic formatted search that will perform an action using the value of a UDF, say some formatting, the problem is I want it to work with any marketing document.
    The only way I can find to access a UDF though is by having to use the
    $[TABLE.U_FIELDNAME]
    way, which seems to mean by definition I can only create a formatted search to access a header UDF for a single type of document. I cannot create a generic formatted search, that reverses the string for example, and use that formatted search across all marketing documents.
    I know you can access normal fields also by their item reference, i.e.
    $[$4.0.0]
    , but this syntax does not seem to work with UDF, even though the system information shows the item reference as U_VALUE, I cannot use the
    $[$U_VALUE.0.0]
    which would be ideal...
    Edited by: Daniel Abbatt on Apr 14, 2008 12:05 PM

  • Using a formatted search which incorporates copying data from base document

    Hi
    I have a user selling tiles.  They sell by sq meter but will only sell whole boxes.  I have a formatted search on the quantity field to calculate the number of sq meters in a box.  They also sell indivudual units and will key this value directly into the quantity field.  All this works fine.
    However if I enter this as a sales order and copy to a delivery, then the formatted search fires and the quantity field gets refreshed.  This results in the incorrect value where the user had keyed data directly into the qty field in the base document.
    Therefore I need to incorporate my base document values into my query where by if there is a base document, the query will pull the quantity data from the base document.  My query so far is as follows
    SELECT (CAST($[$38.U_ActMtr.0] AS DECIMAL(10, 2))*CAST(T0.U_SqmBox AS DECIMAL(10, 2))) FROM OITM T0 WHERE T0.ItemCode = $[$38.1.0]
    Any suggestions?
    David

    If I understand your requirements well, you want to save the base quantity, when the delivery is based upon a SO, and to compute it when the DLN is not copied.
    Try to use this modified FS:
    declare @q dec(19,6)
    set @q=$[$38.11]
    If $[$38.43]<>-1
    Select @q
    Else
    SELECT (CAST($[$38.U_ActMtr.0] AS DECIMAL(10, 2))*CAST(T0.U_SqmBox AS DECIMAL(10, 2)))
    FROM OITM T0 WHERE T0.ItemCode = $[$38.1.0]

  • Formatted Search on Document Tax.

    Hello All,
    Can I assign a Formatted Search on the Document Tax(That field is always Diabled).
    If there is a way to do it please let me know.
    Thanks in Advance
    Manish Chaudhary

    Hi Manish,
                  U can assign formatted search for any field in B1 system. If u want to disable that field, u have to goto form settings and select table format Tab, select Tax field and then selct the check box Visible and uncheck the Active.
    Thanks,
    Suresh Yerra.

  • I have this formatted search for WharHouse Code in Document

    Hello Experts,
    I have this formatted search for WharHouse Code in Document
    declare @WhsCode char(8)
    if $[ODLN.Series] = '1077' set @WhsCode = '970'
    else set @WhsCode = '01'
    select @WhsCode
    and i would like to add to it:
    If an item has a default warehouse so it is to appear in a row (when not '1077' series) and if the item does not has a default warehouse then the  warehouse  eill be 01.
    Your Help Please!
    Thank You
    Meital

    Hi Meital,
    Try this:
    SELECT CASE WHEN $[ODLN.Series\] = '1077' THEN '970' ELSE ISNULL(T0.DfltWH,'01')
    FROM dbo.OITM T0 WHERE T0.ItemCode = $[$38.1.0\]
    Thanks,
    Gordon

  • Problem With Formatted Search.

    Hi to all,
    I have linked a formatted search to a UDF that lies at row level in AP Invoice. This field is used to display the Sales  Order Price. The requirement is that from SO we create a purchase order and subsequently create a goods receipt and AP invoice.. Now in invoice it is showin perfectly fine whether it is copied from goods receipt or purchase order.. But in the purchase order and goods receipt screen this query will not work. And the same query used in AP invoice is being linked to these documents. Is there any work around for this?? Is it possible to run queries based on the form numbers?? If so ho do i pull the form number in the formatted search query??
    Please Help!!!!
    Regards
    Aris

    I recommend creating separate queries for each document.
    ie
    1 formatted search to lookup price on sales order from AP Invoice
    1 formatted search to lookup price on sales order from GRPO
    1 formatted search to lookup price on sales order from PO
    then change the lookup to pull fields from the document that you are using as a reference.
    when you are building the formatted searhes start by returning the values that are you are using as a reference. That way you are sure that you are pulling the correct information.
    Then layer in the lookup to the sales order.
    If you get stuck I recommend that you copy and paste the formatted search in SQL Server management studio and replace the variables refereces with real values.
    In my experience troubleshooting queries is more effective when using SQL Server management studio. (the error reporting is better).

  • Formatted Search issue

    I have a UDF attached to a Purchase Order, Goods Receipt PO and Batch Numbers for Items.  B1 automatically carries the UDF data forward from the Purchase Order to the Goods Receipt PO.  However, I am trying to create a Formatted Search that will also bring that data into the Batches Setup transaction when a Goods Receipt PO transaction is being added.  Since the Goods Receipt PO record is not yet written when the Batches Setup screen is activated, I somehow need to access the UDF data from POR1 from the Batches Setup screen (OIBT).  I don't seem to be able to find a way of writing my query for the formatted search that is able to return the data from POR1 to my UDF in OIBT.  Any ideas of how I might be do this?

    Timothy,
    The values in the Purchase Order / Goods Receipt screen are not available in teh Batch Number screen.
    You will need to use a temp table to store the values from the Purchase Order / Goods Receipt screen.
    You will set a formatted search on one of the columns of the documents row.  Through this formatted search you will insert the data into the temp table and from the Batch screen you will read the values from this temp table
    Suda

  • Include the "created by" field in formatted searches

    Hello
    Very stupid question : how do you include the "created by" (usersign) field in a formatted search for marketing document ? Where do you find the variable numbers since this field is not visible on screen ?
    Thanks for your help
    Fabrice

    HI Milton Rafael Mazzali ,
    $[USER] will display user number only.
    First decided where u want to display user name. Create a formatted search for that field with this Query  "SELECT T0.U_NAME FROM OUSR T0 WHERE T0.INTERNAL_K = $[USER]" and select auto refresh when customer code/name changes.
    This will work.
    Regards
    Ramesh Kumar

  • Change Document Numbering for Contracts

    Experts,
    I have a client who wants to create a new Document Series for the Contracts and Service Calls in SBO. I do not see these documents available in the Document Numbering screen. Is this possible?
    Thanks,
    Marli

    Hi
    The service call numbering is a sequential number that is determined by the system. This information was mentioned in the Online Help - Service Call: General Area. At this stage, there is no option to define the Service Call numbers; however, you may consider the use of a User Defined Field. In this field, you can define a formatted search (Query adding 1 to the next Call ID).
    Paulo Calado
    SAP Business One Forums Team

Maybe you are looking for

  • Sorting alphabetically

    I have two classes: 1.class Record -Constructor Summary Record(String artist, String name, String category) -Methods String getArtist() String getCategory() String getName() 2.class CDRack This is a part of it: /** Class CDRack represents collections

  • LaserJet P2015dn Washed Out Print

    The cartridege and printer is brand spanking new. Word, Excel documents print superbly. However, if I print something from a website it is barely readable, same for my email messages. I use Gadwin Print Screen software and that results also in printi

  • I don't find Utiliser un code dans la section Raccourcis de Mac App Store

    Hello Bonjour Je ne dois pas être réveillée mais je ne trouve pas dans Mac App Store "utiliser un code dans la section raccourcis de Mac App" Merci de m'aider pour installer le nouvel IOS

  • I need help! Ipad3 won't restore... what have I done?

    I am completely new to ipads, and waited for the third one to come out to finally buy one. So I connected up with wi-fi and my mail was coming through, but when I connected via cable to my imac (version 10.6.8), nothing happened. It's supposed to ope

  • Unable to link Jtext field with third party software.

    Hi pals, I am stuck in a problem which is as follows: "I have one third party software (lightspeed) which helps one to link it to any application. Here I am able to link this app with the text field of google.com opened in a browser or in a java fram