[X3v12-4GL] How to run silent Export from an Export template in 4GL only?

SOLVED

Hi,

In 4GL, I know for silent import, there is IMPORTSIL (From GIMPOBJ).

How about, in 4GL, the silent export function with filter option?

I know I can do a manual file write inside the 4GL script but it is very annoying to maintain.

Web service is out of scope at the moment due to access limitations set by the management and only must work with delimited X3 format files.

Reference I found:

From Sage City:

- Concept level: https://www.sagecity.com/us/sage_x3/f/general-discussion/108154/exporting-data-from-sage-x3-from-application-level/299552 and https://www.sagecity.com/us/sage_x3/f/general-discussion/134528/data-extracts/357618

From online help, for IMPORTSIL:

- Technical explanation: https://online-help.sageerpx3.com/erp/9/staticpost/importexport-templates-technical-annex

- Simplified guide: https://online-help.sageerpx3.com/erp/9/ticket/how-to-use-importsil-to-trigger-silent-imports-by-code

No reference found for export template keyword.

  • +1
    verified answer

    I found the following post from Sage X3 France board.

    https://www.sagecity.com/fr/sage-x3/f/technique/132992/realiser-un-export-silencieux-en-creation-d-objet/353538#353538

    I've never done this before, but I believe you can fill up the necessary parameter under screen [M:EXP2], and then use "Call EXPORTSIL From GEXPOBJ" to export. Not exactly an answer, but I hope this help you move forward. 

    Mike

  • +1
    verified answer

    I prefer to work with the subprogram publication, AOWSEXPORT, used by the SOAP export service. Instead of calling it through a SOAP call, you can call it from within your subprogram. The AOWSEXPORT wrapper provides a significant amount of error handling for you, and it makes use of standard templates to export the file to local Clbfile variable. Once you have the Clbfile you can write it to a file or push it to an outside REST service as a direct call with the Clbfile as payload. Also if you want to silence any log output by the IMPORTSIL/EXPORTSIL function you can do so by setting the GSILENCE variable to 1. 

    [V]GSILENCE = [V]CST_ATRUE

    Call EXPORT(I_MODEXP,I_CHRONO,I_TCRITERE,I_EXEC,I_RECORDSEP,O_FILE, O_REQNUM,O_STATUS,O_MESSA) From AOWSEXPORT

    [V]GSILENCE = [V]CST_AFALSE

    # EXPORT OF RECORDS
    ###########################################################################################
    # I_MODEXP - EXPORT TEMPLATE
    # I_CHRONO - CHRONO MANAGEMENT
    # I_TCRITERE - CRITERIA
    # I_RECORDSEP - RECORD SEPARATOR
    # I_EXEC - EXECUTION TYPE 
    # O_FILE - DATA FILE
    # O_REQNUM - QUERY
    # O_STATUS - STATUS
    # O_MESSA - MESSAGE

    https://developer.sage.com/x3/import-export-guide/developing-with-web-services/#perform-an-export