Categorie
Sage X3 Tips & Tricks

Sage X3 how get a list of client running processes

The following Subprog returns into an Integer array the list of all running processes of clients connected to X3 application server.
The Subprog needs this two local variables as parameters:
XPROCID, an Integer array in which are inserted the numbers of running processes
XNUM, an Integer which returns the count of running processes

Categorie
Sage X3 Tips & Tricks

Sage X3 Create tunnels

How-to open an X3 object (eg: a purchase order) programmatically

Local Char W_CLE1 : W_CLE1 = "PO0000001" #number of a purchase order
Local Char W_CLE2 : W_CLE2 = ""
Call OBJET_CHAR(W_CLE1,"POH",W_CLE2) From GOBJET

 

Categorie
Sage X3 Tips & Tricks

Sage X3 Launch export from program

Run the export

Gosub INIT From GEXPOBJ
Gosub OUVRE From GEXPOBJ
Gosub DEBUT From GEXPOBJ
Gosub OK_SAI From GEXPOBJ
Gosub CONTROLE From GEXPOBJ
[M:EXP2]MODELE = MODELE
[M:EXP2]NOMEXP = 'export.txt'
[M:EXP2]NBFIC = 1 #number of tables setted into the export model
[M:EXP2]FICHIER(0) = Y_FIC #Name of first table
[M:EXP2]ABREV(0) = Y_ABRFIC #shortcut of first table
[M:EXP2]CRITERE(0) = "YFLGIMP<>2" #selection criteria of first table
Gosub EXEC From GEXPOBJ
Gosub TERMINE From GEXPOBJ

 

Categorie
Sage X3 Tips & Tricks

Sage X3 Show a dialog Window

If you need to open a X3 window dialog, not full size windows with left browsers, from a program please follow these instructions.

Categorie
Sage X3 Tips & Tricks

Sage X3 how to run import from program

Run the import
Here how to execute an import

Local Char PARAM(15)(1..4) , VALEUR(15)
Gosub INIT From GIMPOBJ
Gosub DEBUT From GIMPOBJ
Gosub OK_SAI From GIMPOBJ
Gosub CONTROLE From GIMPOBJ
[M:IMP2]MODIMP = MODELE
[M:IMP2]NOMIMP = FICHIER
Gosub EXEC From GIMPOBJ
Gosub TERMINE From GIMPOBJ
If GERRTRACE = 1 and GERRTRACE = 3 Then
  Errbox "Si è verificato un errore in fase di importazione del ricevimento", "Controllare il file traccia " + GTRACE titled "Import Ricevimenti"
Endif
Call LECFIC("TRA",GTRACE,"tra") From LECFIC