5 Replies Latest reply on Sep 24, 2013 10:56 AM by GregSmith_1

    User Defined Variable.... I think



      User Defined Variable.... I think


           All --


           I've searched the forums and I'm coming up short, so I'm hoping that I'm just missing something simple.

           I have a "2 part" script where I'm sorting customers. Part #1 works just fine.... now I want to add in a step where the user/client can add in a variable ( ie. customers that have spent less than $500.00) I've "hard coded" this and it works just great, my problem is getting the user defined variable to happen.

           I just want to open a simple custom dialog box so they can enter the amount and have the script proceed when they submit, I just can't figure out getting the variable into the script.

           Currently: Perform Find > Find Records >Customers::Total Invoices Paid ≥500 - can't seem to figure out how to make that 500 a variable.

           Can anyone assist??




        • 1. Re: User Defined Variable.... I think

               Hello Greg,

               Short version is that you need to create a global field.  Then that global can be used in a custom dialog box.  When in the "Show Custom Dialog" go to the tab "Input Fields" where you can choose your field and other options.

               Use that field in your search.

               Hope that helps (HTH)

          • 2. Re: User Defined Variable.... I think

                 Here's a thread with scripted find examples that use a global field like IT _User is describing: Scripted Find Examples

            • 3. Re: User Defined Variable.... I think

                   Hey Folks, thank you for the information, but I am still having no joy.... I've got to be doing something stupid, so I'm hoping that someone can point to my mistake. I've paraphrased a little here...

                   Script as follows:

                   go to layout[customers] - this works

                   perform find[ omit records = not active] - this works

                   Enter User defined item - HELP!!!!!!

                   export records[] - this works


                   What I wish to do is allow the user to modify the initial find by Omitting records where the user has not spent over a certain amount.

                   I have set up a global field gOverAmount

                   I have set the storage of gOverAmount to global

                   Now is where it all unravels... I have opened Show Custom Dialog and selected gOverAmount at the field to modify by the user

                   But from this point on - nothing seems to modify the first find

                   Any additional help would be great - it has to be simple and I'm missing it

              • 4. Re: User Defined Variable.... I think

                     Please check out the scripted find examples in the thread whose link I have already posted. It has examples of what you want to do.

                     What is key is NOT to use perform find like you are attempting. Instead, the script enters find mode and then a series of set field steps set up the criteria--which can be static values that are always specified or values that the user has entered into a global field. THen, a Perform find with no stored criteria produces the desired found set.

                     And "omit" requests are also demoed in that thread.

                • 5. Re: User Defined Variable.... I think

                       PhilModJunk --

                       Thank you, the NOT forced me to come at it in a different fashion and yippeee, skippeeee it works.