control script to set filename

Hi,

I’m trying to use a control script to set the name of the pdf output file that is attached to the email. I want to set the file name to the value of a field. I tried the following syntax but I just get 'org.mozilla.javascript.Undefined@dae9e1c.pdf ’ as the filename:

Thanks

record.detail is a detail table, which is an array of records.

You need to pick a specific record from that array to access the ‘email’ field. For example: record.detail[0]['email'] or record.detail[0].email

Note: If you type record.detail. (with a period at the end) you should get a list of proposals, and ‘email’ will not be one of them. If you type record.detail[0]. however, you should see ‘email’ in that list.

Thanks for the explanation, it works perfect now. :slightly_smiling_face: