2 Replies Latest reply on May 3, 2015 2:34 PM by Fred_3

    Table Lookup



      Table Lookup


      I have a simple, (unrelated?) table with NAMES, and PHONE NUMBERS.  I am trying to write a portion of a script that selects a name from a drop down list and sets a variable to the related PHONE NUMBERS from the table.  Can anyone help?

        • 1. Re: Table Lookup

          This can be done, but why? Why not make it a related table so that you don't have to script a find to access this data?

          If your drop down list is set up to format a global field, a script such as those found here: Scripted Find Examples

          Will find the record or records matching the info entered or selected for your global field.

          • 2. Re: Table Lookup
            Thank you so much for responding.
            I should have asked the question differently.  I might have done that the first time if I wasn't new to the program, but I didn't want to bother you with all the specific details of my little problem.
            I have the following script that works, but would like to replace the CASE command with a table:
            If [ List Parameters::Mobile Numbers ≠ "-" ]
            Set Error Capture [ On ]
            Set Field [ <Table Missing>; "" ]
            Set Variable [ $$MOBILENUMBER; Value:Case ( List Parameters::Mobile Numbers = "Fred" ; "8884532180" ; List Parameters:: Mobile Numbers = "Mike" ; "8886542323" ; List Parameters::Mobile Numbers = "Tom" ; "8887654323" ) ]
            Set Variable [ $$SCRIPT_TRIGGER; Value:"Off" ] End If
            Send Mail [ Send via SMTP Server; To: $$MOBILENUMBER & "@txt.att.net"; Message: Residential Customers::Last Name & ", " & Residential Customers::First Names & ¶ &
            Residential Customers::Street Address & ¶ &
            Residential Customers::City & " " & Residential Customers::Zip & ¶ &
            Residential Customers::Phone & ¶ &

            Residential Customers::Number of Systems & " Systems"; Name: "Douglas Mechanical, Inc."; Email Address: "douglasmechinc@gmail.com"; Reply-To Address: "douglasmechinc@gmail.com"; SMTP Server: "smtp.gmail.com"; Port: 465; Use SSL; Authentication Type: Plain Password; User Name: "douglasmechinc@gmail.com"; Password: "**********"
            My thinking is that if the names and numbers are in an easily viewable table, the numbers could be easily changed by others without changing the script.  The table would be as follows:
            EMPLOYEES table
            NAMES        MOBILE NUMBERS
            Fred             8884532180
            Mike             8886542323
            Tom              8887654323
            Any thoughts?  And thank you for your time.