5 Replies Latest reply on Feb 26, 2010 5:42 AM by Legendary

    Insert variable in "open url"

    Legendary

      Title

      Insert variable in "open url"

      Post

      How do you insert a variable in a url?

       

      The "Work Order" field contains the number.  63291.

       

      With a button click, I want to call   f:\pdfs\Work Order.pdf

       

      I have the button. If I hard code in 63291, it works.   f:\pdfs\63291.pdf

       

      Thanks

        • 1. Re: Insert variable in "open url"
          philmodjunk
            

          Enter "f:\pdfs\" & YourTable::YourNumberField & ".pdf"

           

          (If you click the second specify button to appear, you get a specify calculation dialog box where it's easier to construct these types of expressions.)

          • 2. Re: Insert variable in "open url"
            Legendary
              

            Phil,

             

            When I carefully add the code you suggested, I get  "The number can't be evaluated" message.

             

            Both my table and field have word spaces in the name.  Could this be the problem?

             

            Thanks,

             

            Wendell

             

             

            • 3. Re: Insert variable in "open url"
              Legendary
                

              I renamed my table and field to remove wordspace. That didn't help.

               

              I get erratic results.

               

              When I enter the specification:

               

              "f:\aa-spa\" & WORKORDER::Work_Order & ".pdf"

               

              and select OK, this is the result I see:

               

              "\"f:\aa-spa\\\" & WORKORDER::Work_Order & \".pdf\""

               

              If I just put WORKORDER::Work_Order in the specification, it returns the number 63291

              If I then add & ".pdf", it returns 63291.pdf

              If I then add "f:\aa-spa\" &  it adds backslashes and quotes.  I figure the backslashes are the problem, but I've tried adding and subtracting those guys and can't get anywhere.

               

              If I enter this in the calculation field, I can't get it to close on OK.  I've had to add this in the first specification field.

               

              Thanks much for your help.

               

              Wendell 

               

               

               

              • 4. Re: Insert variable in "open url"
                comment_1
                  

                In a calculation, the backslash is an escape character. A backslash followed by a quote means literal quote, so:

                 

                "f:\pdfs\" & Table::Field & ".pdf"

                 

                is an invalid expression. Try:

                 

                "f:\\pdfs\\" & Table::Field & ".pdf"

                • 5. Re: Insert variable in "open url"
                  Legendary

                  Comment

                   

                  Properly notifying the calculation of the literal backslashes worked!

                   

                  It's so much fun to see some process work on the first test after you've been fussing with it for hours.

                   

                  Thanks for the tip.

                   

                  Wendell