1 Reply Latest reply on Jan 3, 2013 8:44 PM by philmodjunk

    Insert Perform Find calculated results into table

    NetDude

      Title

      Insert Perform Find calculated results into table

      Post

            

      Scenario:

           Execute a script that will execute 2 Perform Finds. Calculate the results from the finds and enter results into a Results Table. Will also need to insert the id for the current record. I started doing the following however Im not sure how I perform the insert. My example below stores each peform find result into a variable, I also store the current record into a variable to be used in each perform find and eventually for using in the insert along with the calculated result. The Result table for this eaxample only stores two pieces of data into Results table:

             
      1.           ven_id
      2.      
      3.           calculated percent  (calculation: variable $total_yes / $total_hie * 100) It would be nice to limit how many characters to the right of the decimal will go as apposed to my example below which carries them out 12 spaces

           Because Im using Perform Find, Iv'e noticed that if they do not find any records then the auto "No Records Found" displays prior to getting through the rest of the script. If this happens then no records should be inserted and the user will simply be alerted and then taken to the Orginal Layour as apposed to being allowed to enter new search parameters. One other issue Ive seen with just this example is that it doesn't clear out previous finds within each variable. Im wndering if I need to flush them prior to running the script to avoid using the same record ven_id

        • 1. Re: Insert Perform Find calculated results into table
          philmodjunk

               It may be possible to set up a summary report that produces these same figures without needing to store results in a results table--it depends on the stored criteria you are using in this perform find steps as to whether or not that will work.

               But to log the results in another table:

               Go to Layout [Results table]
               New REcord/Request
               Set FIeld [Results::Ven_ID ; $Ven_id]
               Set Field [Results::Total_hie ; $Total_hie]
               Set Field [Results::Total_yes ; $total_yes]
               Go to Layout [Original Layout]

               ON the other hand, if you need to use a script to update an existing record in Results for a given vendor ID, the script would need to find that record instead of creating a new one.