CoreBOSBB
[SOLVED] How to change exported odt filename with Gendoc - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: User Support (https://discussions.corebos.org/forumdisplay.php?fid=6)
+--- Thread: [SOLVED] How to change exported odt filename with Gendoc (/showthread.php?tid=2785)

Pages: 1 2


[SOLVED] How to change exported odt filename with Gendoc - geraldbigot - 07-03-2023

Hello,
I was looking in modules/evvtgendoc files to find where I could change the file name when export in odt but no luck.
Now, when I export in odt, in Ticket module, I obtain : "ModuleName"_"Ticket_Title".odt and I would like :  

"ModuleName"_"Ticket_Title"_"Ticket_number".odt

Could you help me doing that ?
Thanks.


RE: How to change exported odt filename with Gendoc - joebordes - 07-03-2023

There is a global variables for that: GenDoc_Attachment_Name

have you tried that one?


RE: How to change exported odt filename with Gendoc - geraldbigot - 07-03-2023

(07-03-2023, 06:51 AM)joebordes Wrote: There is a global variables for that: GenDoc_Attachment_Name

have you tried that one?

I only see these Gendoc vars :

GenDoc_Convert_URL
GenDoc_CopyLabelToClipboard
GenDoc_Default_Compile_Language
GenDoc_PDFConversion_Retries
GenDoc_Save_Document_Folder

I need to update


RE: How to change exported odt filename with Gendoc - joebordes - 07-03-2023

can you update?


RE: How to change exported odt filename with Gendoc - geraldbigot - 07-03-2023

I found this GV but I don't know how to add "ticket_number" in the filename with this GV :

Workflow_Email_GenDoc_Attachment_Name String Name|Number When merging a GenDoc workflow email attachment, the name used for the attachment will be the Entity Name field (Name) or the Entity Number field (Number) concatenated with the template name.


RE: How to change exported odt filename with Gendoc - xhilda.shazivari - 08-07-2023

(07-03-2023, 07:49 AM)geraldbigot Wrote: I found this GV but I don't know how to add "ticket_number" in the filename with this GV :

Workflow_Email_GenDoc_Attachment_Name String Name|Number When merging a GenDoc workflow email attachment, the name used for the attachment will be the Entity Name field (Name) or the Entity Number field (Number) concatenated with the template name.

Hello,

In order to get this filename ("ModuleName"_"Ticket_Title"_"Ticket_number".odt), which is a "concat" expression, means you have to:

1. Create a Business Map, type: Condition Expression where you form the expression you need.
2.  Set value of the GV (Workflow_Email_GenDoc_Attachment_Name) to Expression.
3. Relate the Business Map you created with the Workflow_Email_GenDoc_Attachment_Name GV .

Hope it helps, let us know.

Thank you,
Xhilda


RE: How to change exported odt filename with Gendoc - geraldbigot - 10-16-2023

Hello Xhilda,

Could you give me more details from your last explanation ?

I mean : which field ? Which exact value ? And the relation to establish between GV and WF ?

Thank you
Gérald


RE: How to change exported odt filename with Gendoc - joebordes - 10-20-2023

Hi

It isn't exactly the same but the next three images show how to change the name of the download PDF in Quotes, the workflow GV is almost identical. HTH


RE: How to change exported odt filename with Gendoc - geraldbigot - 10-23-2023

Hi,

I tried your example but export gives me such file : "pdf.pdf" instead of 45650_CLIENT.pdf
Just to be sure of the syntax, is the content :

<map><expression><![CDATA[stringreplace('__',",stringreplace('','_',stringreplace('&','and',concat(quote_no,'_',account_id)) ))]]></expression></map>

Gérald


RE: How to change exported odt filename with Gendoc - joebordes - 10-23-2023

ok. the expression above is for QUOTES, it won't work anywhere else, and it is doing a bunch of transformations you may not need

it was just an example of one that is working

the one I shared does this:

- concatenates the quote_no with an underscore and the account_id (both fields only available in a quote
- replaces all ampersand for the string 'and'
- replaces all spaces with an underscore
- deletes all double underscores

you have to create your own for your own purpose