What is the file path of printed reports? (GFILPATH)

Hello,

I'm trying to find the directory where printed reports are, and call it in the context of an ASYRMAIL attachment, however, I can't seem to get the code right. I am passing GFILPATH through a workflow, which returns the exact name of the report, but not the full file structure. I have tried the following:

ATTACHMENTS(1) = "[TMP]/GFILPATH" - result is a blank file called GFILPATH

ATTACHMENTS(1) = "[TMP]\GFILPATH" - result is a blank file called GFILPATH

ATTACHMENTS(1) = "[TMP]/"+GFILPATH - result is a blank file with the name of the report

ATTACHMENTS(1) = "[TMP]\"+GFILPATH - result is a blank file with the name of the report

ATTACHMENTS(1) = [TMP]GFILPATH - No error but no email was sent

Can anyone assist?

Thank you

Zoey

  • 0

    You can probably find your answer here https://online-help.sageerpx3.com/erp/12/staticpost/report-as-enclosure/?highlight=GFILPATH.
    That's a Workflows variable.
    Are you in Workflows context?

  • 0 in reply to JBA

    Hello,

    I will try to be more clear. I am using the Attached Report workflow trigger to run an action / piece of code. The GFILPATH variable contains the name of the file, but I am not sure how to use it in the context of 4GL.

    I want to use this function to attach the report programmatically:

    If func ZCUSTOM.SUPPEM([M:RPT]VALEUR1(1))<> ''
    A_USER(1)= func ZCUSTOM.SUPPEM([M:RPT]VALEUR1(1))
    ATTACHMENTS(1) = GFILPATH
    HEADER="EFT Payment Report - "+[M:RPT]VALEUR1(0)
    ISSUERMAIL="noreply"
    TRACE = 2

    Append BODY , 'Hello,'+chr$(10)+chr$(10)
    Append BODY , 'Please find attached an EFT report for your conveience.'+chr$(10)+chr$(10)
    Append BODY , 'Best,'+chr$(10)+chr$(10)
    Append BODY , 'Monk Office Accounts Payable'+chr$(10)

    STA =func ASYRMAIL.ASEND_MAIL(GACTX,ISSUERMAIL,A_USER,CC_USER,HEADER,BODY,ATTACHMENTS,TRACE)
    If STA <> [V]CST_AOK Then
    infbox( mess(1163,196,1))
    Endif

    Else Infbox "No supplier email found" : Endif
    Return