+2712 88 00 258
KB20230710/01: Sage X3 Tip & Trick – How to change the name of a file created from a workflow email
When a report is run a workflow is generated with the report attached. How do you change the name of the report file attached to that workflow email?
The document name generated is hard coded. You can use an entry point to rename the file before sending the file that is built with the GFILPATH variable. Before making any changes contact your developing partner for assistance.
Please note – The following is only an example of usage:
Entry Point MESSAGE from AWRK
$ACTION
#Infbox ” ACTION “+ACTION
Case ACTION
When “MESSAGE” : Gosub MESSAGE
Endcase
Return
$MESSAGE
# We want to do that only for some Workflow Rules
If [F:AWA]CODE <> “MYRULE”
Return
Endif
Local Char FICHIER(80), NAME(80)
Local Integer STAT
# Here we build the path and the name for the attached PDF
NAME = “\NEW_NAME.pdf”
FICHIER=filepath(“”,””,””)+NAME
# Then we rename the generated pdf
Call MOVE (PCEJOI(NBJOI),FICHIER,STAT) From ORDSYS
PCEJOI(NBJOI)=FICHIER
Return