5 Replies Latest reply on Oct 23, 2016 3:29 PM by marksystech

    Perform find on currency

    marksystech

      Hi all,

       

      My client wants to have a general purpose find functionality that lets them find purchase orders in their system on company name, address, items, etc.   Recently they asked if the find could include amount.

       

      The POs are a PO record with the items in a PO items table.  So the total for a PO is calculation defined as:

       

      Sum ( PurchaseOrderItem::PurchaseOrderItem_ExtendedCost ) + PurchaseOrder_ShippingCost

       

      In my find button script I have a bunch of find requests on name, address, etc.  I've been trying to add a find request that works on the PO total.  The find item is stored in a variable $findEntry.

       

      I've tried adding a find request that looks like

       

      PurchaseOrder::PurchaseOrder_Total = $findEntry.     That didn't work.

      PurchaseOrder::PurchaseOrder_Total == $findEntry.     That didn't work.

      PurchaseOrder::PurchaseOrder_Total = GetAsNumber($findEntry).     That didn't work.

      PurchaseOrder::PurchaseOrder_Total >= GetAsNumber($findEntry) & <= GetAsNumber($findEntry).     That didn't work.

       

      I'm probably just messing syntax or something but the Perform Find script function seems to allow a bunch of find requests but the syntax in the find requests is not quite like a script it seems.

       

      If the above is not really gonna work I guess I could always create a global field, assign the value to the global field then find records based on a match with the global field.

       

      Anyway ideas would be appreciated.

        • 1. Re: Perform find on currency
          David Moyer

          Hi,

          have you tested a situation where PurchaseOrder::PurchaseOrder_Total exactly equaled $findEntry?  That should work.  If you use a range, like > and <, then you definitely need to reformulate that query - no ampersands - AND instead.

          1 of 1 people found this helpful
          • 2. Re: Perform find on currency
            philmodjunk

            Are you using a stored find request?

             

            if so, don't why it didn't work for you. Perhaps you should post a screen shot of the dialog box.

             

            I I prefer to script finds like this:

             

            Enter Find Mide [ ]

            set field [purchaseorder::purchaseOrder_total ; $findentry]

            set error capture [ on ]

            perform find [  ]

             

            For a number value, you shouldn't need the = operator, but if you used it, the set field step would look like this:

            set field [purchaseorder::purchaseOrder_total ; "==" & $findentry]

            1 of 1 people found this helpful
            • 3. Re: Perform find on currency
              David Moyer

              Is PurchaseOrder::PurchaseOrder_Total an unstored calculation?

              1 of 1 people found this helpful
              • 4. Re: Perform find on currency
                David Moyer

                By the way, I use you to spread the message ...

                It's better to "Ask a question" than "Start a discussion" on the forum.  The Forum doesn't make this an obvious option - I don't know why.  In my opinion, here's what it should look like:

                Question hope.PNG

                Thanks to all.

                1 of 1 people found this helpful
                • 5. Re: Perform find on currency
                  marksystech

                  Thanks Phil and David.  My apologies for not making it a question.  I guess I hit the wrong button.

                   

                  Both of you contributed to fixing my issue.  The situation was that the calculation was unstored and also the syntax in the find request was wrong.  So thanks to both.

                   

                  I ended up adding a stored field and when the PO is submitted forcing the calculation and storing it.  Once I did that and fixed my syntax in my find request I can now find exact values.

                   

                  Thanks!