Formatted Search IN OINV

Experts,
Good Day!
I have a UDF in OINV where I want to compute sum of amount in INV1.
Example:
INV1.PPD_Amount (UDF)  Line 1   1000
INV1.PPD_Amount (UDF)  Line 2   1000
INV1.PPD_Amount (UDF)  Line 3   1000
Total Amount                                 3000
Is there a way where I can use Formatted search to compute for this?
Thanks
Sandra

hello
pls do clear ur questions u want the sum of three udfs in row level like Ur row level is
row wise 1000 1000 1000 3000 or u want  column wise 1000 which query u want                                                                               
1000
                                                                                1000
                                                                                3000
regards
Jenny

Similar Messages

  • 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)?

  • Formatted search query for displaying invoice items details

    hi all,
    i need to display all the items in AP invoice.kindly suggest me a query for that.
    in AP invoice
    Ex. row items
    code--descqtyprice--
    total
    I0001--XXXXXXX5--
    100 -
    500
    query should display this row as
    code--desc--
    price
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    =================================
    the query should display as the qty is 5 so it will display the same item 5 times
    kindly suggest me some query for formatted search
    its very urgent
    regards
    sandip

    Hi Sandip,
    DoQuery("Select b.ItemCode from OINV a,INV1 b Where a.DocEntry=b.DocEntry")
    Hope its help for you
    Give me reward points,
    Regards,
    G.Suresh.

  • Fill Find edit box of Formatted search screen

    Hi,
    I have an edit box and a choose button.
    when I click on that choose button I get a formatted search screen.
    I want the value typed in the edit box to be defaulted in the
    Find Edit box of the foratted search screen.
    Say I type "1" in my edit box, My formatted search screen should pop up having "1"
    in the Find edit box and results pertaining to value "1"(like wild card search)
    should be displayed in the formatteed search screen.
    Can anyone tell me as how to implement this?

    The reference to $[x.0.0] was simply meant to point you towards using the formatted search syntax for selecting fields from the current screen for use in your query.
    The two techniques I mentioned were not meant to be used together, you could either use the sendkeys, or the $[x.0.0] syntax depending on which result you wanted.
    The $[x.0.0] syntax actually goes in the query that is saved for the formatted search, you don't need to do anything with it programatically at runtime, business one does it for you.  You can get a formatted search to pick values up from the current screen by using syntax such as $[$4.0.0] or $[$OINV.CARDCODE]. This particular example will pick up the cardcode from a document screen.  Look in the standard help file under Formatted Searches for more details.
    I have attached a sample query showing how it can be used with fields based on userdatasources in custom screens.  This one can be used to show product lookups out when the user has already keyed in a partial product code.  At runtime the $[#018.UItem] reference automatically gets replaced with the value currently in the item field.
    DECLARE @Item Varchar(20)
    SET @Item = RTRIM($[#018.UItem]) + '%'
    SELECT T0.ItemCode, T0.ItemName FROM OITM T0 WHERE T0.ItemCode LIKE @Item FOR BROWSE
    If you haven't seen this type of formatted search processing before, I would recommend you try to spend a little time learning it - it sometimes eliminates the need for writing SDK code at all.
    Regards,
    John.

  • 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

  • Formatted Search Inconsistency

    Hi All,
    Quite frustrated with a formatted search at the moment. Your help is appreciated. I've got an amount and a percentage field. I want to work out the amount after discount.
    If I do this calculation in a matrix, it works fine, but on the header of a record it does not. Herewith my queries: (I have the same fields on header of invoice and on rows): Amount field is Units and Totals, Price and Perc field is Units and Totals, Percentage.
    In matrix (working):
    SELECT $[$38.U_Amount.Number] - ($[$38.U_Amount.Number] * $[$38.U_Perc.Number] / 100)
    On header (NOT working):
    SELECT $[$U_Amount.0.Number] - ($[$U_Amount.0.Number] * $[$U_Perc.0.Number] / 100)
    I have also tried with $[Table.Field], but that doesn't work on either header or lines.
    Please help,
    Thanks!!!
    Adele.

    OK, got it working.
    I didn't know you can do it this way, but the way I got is solved is as follows. 
    SELECT $[OINV.U_Amount.Number] - ($[OINV.U_Amount.Number] * $[OINV.U_Perc.Number] / 100)
    I thought the .Number was only for the notation of $[$Item.Row.Type]
    Now it's working!!!
    Thanks Ibai for the other notation and thanks Juha for suggesting the query window.
    Thanks for your help.

  • Formatted search can we use current records values ?

    Hi.. to all,
    I have a need to get tax amount from current document at the time of entry before updating the entry by using Formatted search through saved query.
    Can any body help me to resolve it ?
    Regards..
    Chintesh Soni

    Hi,
    You can get the value at entry time (for example on an invoice) by creating a search define query such as:
    [code]SELECT $[OINV.VatSum][/code]
    Then add the search define to a UDF that gets 'Auto Refresh When Field Changes', and select an option like 'Document Total' and 'Display Saved Values'. This way the search define query will refresh the tax value in the UDF when ever the total value changes i.e qty, unit cost, discounts get altered...
    You'll need to alter the query to match different marketing documents and set the search defines on each one.
    Hope this is of help
    Kind Regards
    Matthew

  • 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

  • Formatted Search for Sales Order

    Hi,
    I setup a formatted search in Sales Order unit price field.
    Condition required:
    If Sales Order is copied from Sales Quotation, unit price remains as per Sales Quotation unit price, else formula to calculate mininum selling price appllies.
    Here's the query:
    DECLARE @BASE_ENTRY INT
    DECLARE @PRICE NUMERIC(19,6)
    SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
    SET @PRICE = $[$38.14.0]
    IF @BASE_ENTRY = 0
    BEGIN 
    SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
    FROM OITM T0
    WHERE T0.[ItemCode]=$[$38.1.0]
    END 
    ELSE 
    BEGIN
    SELECT @PRICE
    END
    l have no issue if the Sales Order copied from Sales Quotation, however when enter the Sales Order manually the formatted search having error message:
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Error converting data type nvarchar to numeric.
    FMS execution failed on field '' with query name 'Get Minimum Selling Price (SO)'
    Looks like my query has error...

    Hi ,
    Try this below query and let me know your feedback,
    DECLARE @BASE_ENTRY INT
    DECLARE @PRICE NUMERIC(19,6)
    SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
    SET @PRICE = $[$38.14.Number]
    IF @BASE_ENTRY = 0
    BEGIN
    SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
    FROM OITM T0
    WHERE T0.[ItemCode]=$[$38.1.0]
    END
    ELSE
    BEGIN
    SELECT @PRICE
    END

  • Help needed for Formatted Search

    Hai Experts,
    would like to ask you some clarification on Formatted Search. In the
    query I found $http://$44.2.1 given in the criteria part.
    In some articles it was mentioned that, the 44 meant for the table
    connected with the form and 2 is field index and so on.
    Can you please explain how to find out those numbers and field index.
    I need to work out planty of FMS to fetch data into
    UDF automatically based on user input.
    Regards
    Anand

    Hi Anand,
    You may check these threads first:
    Re: Vendor default GL FMS help
    Re: Runtime data calculation
    Thanks,
    Gordon

  • Formatted Search - Restrict to Only One Customer on Activity Window

    Hello Experts:
    Am trying to create a formatted search to provide a suggested RMA Number on the Business Partners > Activity window in a UDF.
    While in Activity, the user should get a list of ONLY the one customer they are currently working with.  So if C0001 is being used in the Activity window, the list should show all suggested RMA numbers just for that customer of C0001, not any other customer. 
    When I use the following it shows all customers.
    --FMS 6BP Automated RMA Number
    SELECT
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode]))
    FROM OCLG T0
    INNER JOIN OCRD T1
    ON T0.CardCode = T1.CardCode
    ORDER BY
    T1.CardCode Desc,
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode])) Desc
    When I put in WHERE T1.CardCode = $[$ 9.0.0 ] in the right place it shows nothing...
    Any ideas on how to make only the one current customer in Activity window appear in the list???
    Thanks in Advance - Zal

    Thanks Istvan and Gordon...
    Istvan - that is the same as my SQL - just do not know how to show the $[$... correctly in this forum - it always goes to that http thing.
    Gordon - tried to use your SQL but it gave me an error of "Internal Error (-1003) Occured [Message 131-183] every time I tried to click on the magnifying glass.  However, due to your last line in the SQL it gave me an idea that eventually they were OK with - namely, the highest number to the top of T0.ClgCode...
    Thanks again guys - Zal

  • Formatted Search for Delivery Date field in SO not working

    Hi All
    Can anyone help me as to why my formatted search is not working?
    I am currently using SAP B1A SP01 Patch 19.
    I have created a user query as follows:
    SELECT $ [$10.0.DATE] + 5
    When I add this to the delivery field within the Sales Order and bring through the saved query which I set to auto refresh when the Posting Date field changes and to Display Saved Values it doesn't work.
    Any ideas?
    Thanks and best wishes
    Gail

    HI Gail,
    If I am not mistaken you want to add days to the posting date...if that is so then try this out:
    SELECT $[ORDR.DocDate.DATE]+5 From ORDR T0 For Browse
    Set The indicator to Auto Refresh when the fields change
    Nagesh

  • Formated search

    Hi all,
    In Dunning Wizard, step 5, I want to make a formated search to select only some documents. The Query I need is complicated so I tried to do Select ' '  or Select 'N' or Select 'Y' in all this examples when I do "Shift F2" nothing happens. Even with auto Refresh nothing happens. Perhaps Formated Searchs dont work on CheckBox Fields.
    How can I solve this?
    Any help will be apreciated.
    Best regards,
    José Silva
    Edited by: José Silva on Jul 16, 2010 12:45 PM

    HI SILVA,
    plz paste ur query ...
    then we update in query.
    Thanks,
    JRAJPUT

  • How to club 2 queries in one formatted search query

    Hi All,
    I have inserted a formatted search in the stock transfer for chnaging the 'From warehouse' based on series.
    I have written following query for same,
    SELECT $[$18.1.0]='08' WHERE $[OWTR.series] ='46'
    It is working Fine
    I want ot use same concept for selecting other based on other warehouse
    e.g
    SELECT $[$23.5.1]='02' WHERE $[OWTR.series] ='45'
    But I am not able to club these queries on one formatted search query can anybody help to group it in one formatted search query....
    Thanks and Regards,
    Atul Joshi
    Edited by: Atul Joshi on Dec 23, 2008 5:20 PM

    Hi Atul,
    You could define the quey like this
    SELECT
    CASE
             WHEN $[OWTR.series]='46' THEN '08'
             WHEN $[OWTR.series]='45' then '02'
    end
    from OWTR
    Regards,
    Vijay kumar
    SAP Business One Forums Team

  • Is there a way to NOT have the data from a formatted search highlighted

    Hi all,
    I have a formatted search that returns a big chunk of data, some comments that are then added to. When the fs is fired, it returns the data, but all of the data is highlighted so when the user starts typing they overwrite the data that was just returned. I know they could just hit the right arrow key or click their mouse at the end, but they don't do that half of the time. I also know they could use ctrl-z or undo when they do this, but they don't do that either. It would just be nice if they could fire the fs and when the data is returned, the cursor would be at the end of the data.
    Any thoughts?

    I don't think there are any options for you to change default system behavior like this.  What you may do is to change your FMS logic to get only one record if possible. Post your query here if you can.
    Thanks,
    Gordon

Maybe you are looking for