When you insert the PDF file into your container field, make sure that you select "Store only a reference to the file" in the "Insert File" dialog box. Your script should then work.
If you don't choose to store a reference, use export field contents to open the file instead. Using the right scripting, you can export the file to the temporary items folder so you don't have an issue with leaving exported files behind after they've been opened in this way.
Thanks for both the replies, it turns out that may not have been the issue. I switched PDF viewers (from foxit to adobe) and now it appears that the pdf does not actually go into the container field, but the layout on which the container resides. I click the container field and then click insert but it doesn't seem to insert it.
Let me ask a broader question and maybe I could get some feedback.
This layout has a bunch of buttons that print various reports. The reports are layouts with text and some parts auto fill with specific information from the record. These pdfs are simply static documents that they would like to print with some of the dynamic documents, and really they are there as a reminder to print them and nothing more. Is there a better way of doing this? (Aside from telling the person to bite the bullet and try to remember to print them ;) )
If not, how do you insert PDFs at design time? Do these docs need to be inserted for every container field of every record? Any advice would be useful...
If you want data to appear with every record--whether it be a PDF file or any other type of information, you have several options--none of which require you to insert the same information over and over for each record.
You can use global fields to display such information. A global container field, for example can be used to hold your PDF file (or a reference to it's location) and then placing this global field on your layout displays the same PDF file for all records.
You can use a related table. This option sometimes works better in shared databases and can give you the option to link your data to sub groups of all the records instead of one field for all the records.
You can place a web viewer on your layout and use it to display the first page of your PDF document. This web viewer can give you the same view of the same document on all records if you want.