Expand my Community achievements bar.

SOLVED

Can i modify the file name on attachment via script?

Avatar

Level 4

Good morning everyone

 

I was wondering if i could via script, change the name of the PDF file that is created when i use the submit button and it attaches the current PDF into an email.

 

Something like a name + date:: 2023-01-25_FN LN.PDF

And just in the hopes this helps, i use the following script to fire off the said email:

event.target.submitForm({cURL: cEmailURL,cSubmitAs:"PDF",cCharSet:"utf-8"});

 

Thx again for the help, this would be awesome if its doable.

 

PAtrick

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Didn't find any parameter to pass the custom file name.

There is one property 'documentFileName', see if you can do something with this.

If you do :

app.alert(event.target.documentFileName); -> it will give the current file name.

I think something need to be done with documentFileName property.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Didn't find any parameter to pass the custom file name.

There is one property 'documentFileName', see if you can do something with this.

If you do :

app.alert(event.target.documentFileName); -> it will give the current file name.

I think something need to be done with documentFileName property.

Avatar

Level 4

sounds good, i will take a look at that property.

 

thx a lot

Avatar

Level 10

It's not possible to change the name of the attached file via script. You'll have to save the document under the desired name before sending it.