100% found this document useful (1 vote)
739 views

TEC202 Advanced Development Slides

This document outlines the agenda and objectives for the TEC202 Sage X3 Development Course - Advanced. The course covers development templates like the action dictionary, window entry, standard processes and inquiries. It also covers advanced programming topics such as left browsers, entry transactions, entry points, reports, imports/exports and general parameters. Finally, it covers development tools like patches and the development toolkit. The goal is for students to gain familiarity with the X3 development framework and tools to become autonomous developers at an advanced level. Exercises are included to practice working with actions, window entry and other templates.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
739 views

TEC202 Advanced Development Slides

This document outlines the agenda and objectives for the TEC202 Sage X3 Development Course - Advanced. The course covers development templates like the action dictionary, window entry, standard processes and inquiries. It also covers advanced programming topics such as left browsers, entry transactions, entry points, reports, imports/exports and general parameters. Finally, it covers development tools like patches and the development toolkit. The goal is for students to gain familiarity with the X3 development framework and tools to become autonomous developers at an advanced level. Exercises are included to practice working with actions, window entry and other templates.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 77

3/9/21

TRAINING
TEC202- Sage X3 Development Course - Advanced
Sage ERP X3 Fundamentals Sage ERP X3 Advanced Sage ERP X3 Expert

Distribution
Contracts (Purchasing and Sales) Distribution and Inventory
CB 101 – 102 Loan Orders Purchasing Subcontracts
Introduction & Packaging & Shipment Preparation
Purchasing Signature Management Pre-Allocations (Pegging Function)
Functional Overview
Sales and Purchasing Prepayments Radio Terminals
(3 days) TEC102 Sales Reps and Commissions
Development Sourcing: RFQs, Responses
Carrier Management
(4 days) Inter-Site and Intercompany Transactions Manufacturing (5 days)
Invoice Elements (Purchasing & Sales)
Configurator
Kits, Options & Variants
Price List Management (Advanced) Weighing
TEC103 Manufacturing (4 days) Optimisation ILOG
Installation Advanced Global Manufacturing
Production Costing and WIP Posting Finance
(4 days)
Finance Multi-Legislation Set Up
Bank Communication & Reconciliation Operating Budgets
FIN201 - Budget Control/ Analytical Budget
Stock Interface
Finance Financial Data Extraction
(4 days) Statements & Reminders Pre-Consolidation
Automatic Journals & Dimension Defaults Analytical Allocations
Advanced Payment Transactions
Month and Year End Processes Factoring

OPE201 - TEC101 - Fixed Assets


Tools & Development
Distribution Common Tools Inventory (3 days)
Connectors
(3 days) (3 days) Allocation Rules (Advanced)
Java Bridge Serveur
Stock Counts
Components
Serial Number Management
Eclipse
Reodering Replenishment Storage Plan
LDAP integration
Valuation Methods and Price Adjustments
Interface Import/Export
and cost calculations
OPE202 - OPE203 - Quality Control & Sampling
Netvibes
Inventory Manufacturing Sage Search
Tools & Development
(2 days) (3 days) Advanced Common Tools
Advanced Development
You
Are
Here

Course Map
• TEC202- Sage X3 Development Course - Advanced
2
Objectives

At the end of this training, you will be able to :

Get familiar with the X3 development framework


Start using the different tools available
Reach an advanced level of skills to be autonomous

• 3 • TEC202- Sage X3 Development Course - Advanced


1. Development Templates
1.1 – The Action Dictionary
1.2 – Window Entry
1.3 – Standard Process
1.4 – Inquiries
1.5 – Other Templates

2. Advanced Programming
2.1 – Left Browsers
2.2 – Entry Transactions
2.3 – Entry Points
2.4 – Reports
2.5 – Imports And Exports
2.6 – General Parameters

3. Development Tools Course


3.1 – Patches
3.2 – The Development Toolkit
Contents

• 4 • TEC202- Sage X3 Development Course - Advanced


Contents

1. Development Templates
1.1 – The Action Dictionary
1.2 – Window Entry
1.3 – Standard Process
1.4 – Inquiries
1.5 – Other Templates

2. Advanced Programming
2.1 – Left Browsers
2.2 – Entry Transactions
2.3 – Entry Points
2.4 – Reports
2.5 – Imports And Exports
2.6 – General Parameters

3. Development Tools
3.1 – Patches
3.2 – The Development Toolkit

• 5 • TEC202- Sage X3 Development Course - Advanced


1.1 – The Action Dictionary

• 6 • TEC202- Sage X3 Development Course - Advanced


1.1 – The Action Dictionary

The Action Dictionary


The Action Dictionary is an encapsulation of Sage X3 developments
Catalogue of Sage X3 subprograms with parameters

Management of the different development templates


Object
Inquiry
Window Entry
Miscellaneous…
Describing your code as an action is mandatory if any window is opened in the code

The Template field defines the development template that the action will encapsulate
Parameters may be passed to the action, depending on the template
They will be passed to the code as an array of strings, [L]PARAM(1..n)
Parameters may be passed as values (may not be modified) or addresses (may be
modified and returned)
The first parameter may be defined as the value in the current field for actions triggered
from screens
In that case its value is passed in variable [L]VALEUR.
The rest of the parameters are passed as [L]PARAM(1..n)

• 7 • TEC202- Sage X3 Development Course - Advanced


LAB1: X3 Actions management

Exercise 1.1: STD Dictionary Action

OPTIONAL:
Exercise 1.2: Bespoke Dictionary Action

EXERCICES

8 TEC202- Sage X3 Development Course - Advanced


1.2 – Window Entry

• 9 • TEC202- Sage X3 Development Course - Advanced


1.2 – Window Entry

Window Entry

Used to manipulate data through a Window without object encapsulation


No transaction management
No standard Create, Save, Abandon etc. buttons

Simple Complex

Left
Browser
(Possible)

Standard Buttons Standard Buttons

Ok
Ok End
End Ok
Ok End
End

• 10 • TEC202- Sage X3 Development Course - Advanced


1.2 – Window Entry

Window Entry
Definition of a Window Entry action in the dictionary (Ex. from CPTBATCH, Journal Status
Monitor)
Action Dictionary

Action
Action CPTBATCH
CPTBATCH

Template Window Entry

Main Window FBATCH

Standard Process CPTBATCH

Specific Process XWFBATCH

Window Dictionary FBAT0


FBAT0

Window
Window FBATCH
FBATCH

Header Screen

Tab Screens FBAT0

Ok
Ok End
End

CPTBATCH
CPTBATCH

• 11 • TEC202- Sage X3 Development Course - Advanced


1.2 – Window Entry

Window Entry
Common actions
OUVRE Start of action – when tables and additional elements are to be opened (preferred)
OUVRE_BOITE Before entry window is displayed. Same use as OUVRE.
TITRE Before entry window is displayed (Title modification)
Window is displayed
DEBUT After entry window has been displayed (Initialization)
SETBOUT Window/button refresh
AV_CHOIX Before entering the Window
User may access window
APRES_MODIF After modification of any field in the window

Window buttons
AP_CHOIX After button has been pressed
AVANT_BOUTON User buttons: Before button code execution
AVANT_XXX Predefined buttons: Before button code execution (XXX = Button code)
Button action is executed
BOUTON User buttons: After button code execution
XXX Predefined buttons: After button code execution (XXX = Button code)

Window menus
AP_CHOIX After menu has been pressed
AVANT_MEN Before menu action is executed

MEN After menu action is executed Menu action is executed

End of template
FIN End of Window Entry function template

• 12 • TEC202- Sage X3 Development Course - Advanced


LAB2: Window Entry template

Exercise 1: Creating the graphical structure

Exercise 2: Coding the process

EXERCICES

13 TEC202- Sage X3 Development Course - Advanced


1.3 – Standard Process

• 14 • TEC202- Sage X3 Development Course - Advanced


1.3 – Standard Process

Standard Process

Used for long processes such as Automatic Invoice Validation


Initial window entry
Criteria
Dialog box
Simple confirmation window
Main window entry (Usually for complex criteria before running process)
Silent process execution

This template may be run in batch mode (As a batch task)


Trace File
Main
Window

First Entry
Window

Processing

(Other templates may be


encapsulated here)

• 15 • TEC202- Sage X3 Development Course - Advanced


1.3 – Standard Process

Standard Process
Definition of a Standard Process action in the dictionary (Ex. from ATRN,
Transaction Validation)
Action Dictionary

Action
Action ATRN
ATRN Transaction
Transaction Validation
Validation

Template Standard Process

First Entry Dialog Box

Criteria Window ATRN1

Main Window ATRN2

Standard Process DOSWWW

Main Window
Trace File
Criteria Window Transaction Description Validation

Module Validation SO1 Sales Orders Yes


SO2 SO (Simple) Yes
Sales Yes
SO3 SO (Full) Yes
AP/AR No
Accounting No Transaction
Ok
Ok End
End Validation Process
ATRN1
Ok
Ok End
End
ATRN2

DOSWWW
DOSWWW

• 16 • TEC202- Sage X3 Development Course - Advanced


1.3 – Standard Process

Standard Process
Common Actions

INIT Start of Standard Process action


AVANT_PAR Before initial criteria window is opened
INIT_DIA Only for dialog boxes, initialisation of criteria window
Criteria window is displayed
CONTROLE After criteria window has been entered
Criteria window is closed
Main window is displayed
EXEC (If controls are OK) Long process – After main window entry
TERMINE After long process has terminated
Main window is closed
SORTIE End of Standard Process action

Batch Mode
User submits batch job
OUVRE_BATCH Batch job submission (Validation button)
INIT_DIA Before initial criteria window is opened (Batch job submission)

Criteria window is displayed


CONT_BATCH After criteria window is opened (Batch job submission)

Batch job is sent to server

• 17 • TEC202- Sage X3 Development Course - Advanced


LAB3: Processing template

Exercise 1: Creating the graphical structure

Exercise 2: Interactive & Batch mode

EXERCICES

18 TEC202- Sage X3 Development Course - Advanced


1.4 - Inquiries

• 19 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

Inquiries
The Inquiry template presents non-modifiable views of application
data. It is based on one or several Sage X3 tables.
Inquiry screens are customisable by end users through the General
Parameters / Inquiry Screens function.

Header Criteria

Criteria
Window

Standard Buttons
Memo
Memo Recall
Recall OK
OK …

Details

Standard Buttons
Search
Search Next
Next Prev.
Prev. Criteria
Criteria …

• 20 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

Inquiry Definition

Definition of an Inquiry function

Main Window Criteria Window

Header screen Criteria screen

Detail screen(s)

Inquiry Action Function

Criteria Window Inquiry code Action

Main Window

Process

• 21 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

The Inquiry Dictionary

The Inquiry dictionary – Screens (General Information)

Inquiries are identified by 3-character codes


Inquiry XXX
Action CONSXXX
Function CONSXXX

Naming conventions for processes:


Standard Process (Reserved to Sage X3): CNSXXXSTD
Specific Process (Reserved to developers): CNSXXXSPE

Criteria section (Header Fields / Criteria Fields / Display Criterion)


Header Criteria
Matches criteria fields from the header screen to
criteria fields in the criteria window Criteria
This allows the system to automatically transfer Window

values between the two screens


Creates additional action calls in the Inquiry process
Memo
Memo Recall
Recall OK
OK …

• 22 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

The Inquiry Dictionary

The Inquiry dictionary – Miscellaneous

Links the Inquiry to an Sage X3 Linked Object (Inquiry populates the object's
Last Read)

Table and index (Key) specification for magneto buttons (First / Last / previous /
Next) with mapping between Key Components and Inquiry Header Fields

Automation of Site control and Access Code control

Conditions for displaying records

Activation of Inquiry Graphs


Number of lines and columns
Graph types
Starting column

• 23 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

Inquiry Validation

Inquiry Validation
Inquiry Dictionary
Inquiry Screens
Inquiry code XXX

Inquiry Validation Standard Process


(Must be written)
CNSXXXSTD
Generated Process

WWCNSXXX

Specific Process
(Must be written)
CNSXXXSPE

Read/Display Logic

• 24 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

Customisation

Customisation of Inquiry screens (General Parameters / Inquiry


Screens)

Produces a variant of the Inquiry detail window that may be selected by end
users

Customises the following items


Activation / Deactivation of a variant
Access codes (Execution option must be owned by user to use the Inquiry
screen)
Number of detail lines
Number of fixed columns (left of details section)
Order of columns in details section

• 25 • TEC202- Sage X3 Development Course - Advanced


1.4 – Inquiries

Inquiry Actions
Inquiry actions

OUVRE After tables and screens have been opened


TITRE Before Inquiry window is opened and displayed
Inquiry window is displayed

LECTURE When user runs data search or refreshes the screen


SETBOUT When window/buttons are refreshed

FERME When window, screens and tables are closed

User presses custom button


EXEBOUT Button or menu item execution

AV_MAGNETO Before a magneto button is executed User presses mag. button

AP_MAGNETO After searching for the corresponding record (Previous, next etc.)

User opens criteria screen


DEB_CRIT When criteria screen is opened, before it is displayed
FIN_CRIT When criteria screen is closed

• 26 • TEC202- Sage X3 Development Course - Advanced


LAB4: Inquiry template

Exercise 1: Creating the graphical structure

Exercise 2: Coding the Inquiry process

EXERCICES

27 TEC202- Sage X3 Development Course - Advanced


1.5 – Other Templates

• 28 • TEC202- Sage X3 Development Course - Advanced


1.5 – Other Templates

Selection from Table


Selection From Table

Implements a selection window:


Based on a table or a set of joined tables
Columns based on an object's selection parameters
Column structure defined by code
With optional record filters.

Actions:
SEL_TABLE Before selection window is displayed
FILTRE Linked to Object. Filtering the data from object
CHX_TABLE Before selecting the records
Selection window displayed

User selects a record

Table is read ([F] class fully loaded)


VERF_TABLE After user has selected a record
FIN_TABLE End of template

Extra:
BOUT_TABLE After user clicks on a paging arrow (Up/Down)

• 29 • TEC202- Sage X3 Development Course - Advanced


LAB5: Selection from table

Exercise : Creating a selection from table

EXERCICES

30 TEC202- Sage X3 Development Course - Advanced


1.5 – Other Templates

Selection From List

Selection From List

Implements a selection window:


Based on free element array defined by code
With column structure defined by code

Actions:
SEL_LISTE Before selection window is displayed
Selection window displayed

User selects a record

Table is read ([F] class fully


VERF_LISTE After user has selected a record loaded)

FIN_LISTE End of template

• 31 • TEC202- Sage X3 Development Course - Advanced


LAB6: Selection from List

Exercise : Creating a selection from list

EXERCICES

32 TEC202- Sage X3 Development Course - Advanced


1.5 – Other Templates

Miscellaneous Template

The Miscellaneous template

This simply encapsulates a sub-program with no specified development


template.

Single action: TRTDIV.

• 33 • TEC202- Sage X3 Development Course - Advanced


Contents

1. Other Development Templates


1.1 – The Action Dictionary
1.2 – Window Entry
1.3 – Standard Process
1.4 – Inquiries
1.5 – Other Templates

2. Advanced Programming
2.1 – Left Browsers
2.2 – Entry Transactions
2.3 – Entry Points
2.4 – Reports
2.5 – Imports And Exports
2.6 – General Parameters

3. Development Tools
3.1 – Patches
3.2 – The Development Toolkit

• 34 • TEC202- Sage X3 Development Course - Advanced


2.1 – Left Browsers

• 35 • TEC202- Sage X3 Development Course - Advanced


2.1 – Left Browsers

Left Browsers

Additional Left browsers may be added to an object. They may take several
forms:

Simple: Simple list for viewing or loading objects


Hierarchical: List showing data in hierarchical form (Drill-in lists)
Picking: Header/Detail picking
Recursive: Each record in the list points to another record in the main table or linked tables
Simple Picking: Detail picking only.

A browser is defined by creating an object of type Browser (Field Management


Type in the General tab). This is a special type of object in which only the
selection parameters are relevant.

Selection parameters define the columns the browser will show and how it will work (Index,
sort order etc.)
For complex browsers, additional parameters are needed in the Window dictionary.

• 36 • TEC202- Sage X3 Development Course - Advanced


2.1 – Left Browsers

Simple Browsers

Simple browsers show a plain list of items.


The main object browser is usually a simple list, defined by the object itself (e.g.
object SOH will have SOH as a main browser).

Definition of a simple browser (Object dictionary – Same as a


normal object):
Columns (Expressions or table fields from the main table and linked tables (With
link expression only)
Index and sort order

• 37 • TEC202- Sage X3 Development Course - Advanced


2.1 – Left Browsers

Hierarchical Browsers

Hierarchical browsers show data that may be grouped into several


group/subgroup levels.
Users drill into a subgroup in the list by double-clicking the parent node.

Definition of a hierarchical browser (Object dictionary):


Index: The index must have more than one component. The list will group data
by each index component.
The Hierarchical List checkbox must be ticked.

Examples:
Sites (Parameters / General Structure / Sites)
Reports (Development / Processes / Reports / Report Dictionary)

• 38 • TEC202- Sage X3 Development Course - Advanced


2.1 – Left Browsers

Recursive Lists

In recursive lists, each record is linked to a child record from the


main table.
Users browse through linked records by double-clicking corresponding items.

Definition of a recursive list (Window dictionary):


The list must be set as Recursive (Field List Type) in the Browsers tab
The Link Expression field must contain a valid Sage X3 expression consisting
of a filter expression on all or part of the index used with the list.

Example: BOMs (Common Data / BOMs / BOMs)

• 39 • TEC202- Sage X3 Development Course - Advanced


2.2 – Entry Transactions

• 40 • TEC202- Sage X3 Development Course - Advanced


2.2 – Entry Transactions

Entry Transactions

Entry Transactions

An object may have several windows attached to it, with different screens. In that
case each window defines an Entry Transaction against the object.

Entry transactions may be used to:


Allow objects to be managed using complex screens or simpler screens,
depending on the context.
Implement different display rules or business rules for the same object.

Standard entry transaction management has been written for most of the
complex objects such as Sales Orders, Invoices, Work Orders etc.
When validated, entry transaction parameters generate a new window with
new screens based on the original object screens.

Available transactions are displayed in a selection list when the user enters the
object.

• 41 • TEC202- Sage X3 Development Course - Advanced


2.2 – Entry Transactions

Defining And Using Entry Transactions


Using entry transactions

Entry transactions are defined simply be creating more than one window attached to the
same object:
Transaction Code field holds the code that will identify the entry transaction used

In object actions, the transaction code is held in global variable [G]GFLAG.


SPEBPC.src
#######################################
# Customers object (BPC)
# Created additional transaction to
# display foreign customers only
$ACTION
Case ACTION
When "FILTRE" : Gosub OUVRE
When "VERIF_MOD", "VERIF_CRE" : Gosub VERIFICATION
Endcase
Return

#######################################
$FILTRE
# If "FOR" transaction, display foreign customers only
If GFLAG = "FOR"
FILTSUP = "BPCCRY <> 'FRA'"
Endif
Return

• 42 • TEC202- Sage X3 Development Course - Advanced


2.3 – Entry Points

• 43 • TEC202- Sage X3 Development Course - Advanced


2.3 – Entry Points

Entry Points

Entry Points

Entry points are automatic calls of specific processes during the execution of a
"black box" standard function or process, when there is no way of adding a
specific development to the executing template (No object/template action
possible, no field action possible).
Example: Entry point during automatic creation of a shipment from a sales
order, to allow developers to populate additional specific tables or fields.

They are supplied by Sage X3 in standard and on demand.

They are public and documented.

• 44 • TEC202- Sage X3 Development Course - Advanced


2.3 – Entry Points

Using Entry Points

Using entry points

Entry points are activated using the Development / Processes / Entry Points function, by specifying:
The name of the standard process where the entry point is located
The name of the specific process that should be called.

The list of all defined entry points is loaded upon connexion to Sage X3.

If the specific process exists, a $ACTION section is called in that process, with variable ACTION
containing the entry point code.
Entry Points
Standard Specific XVENPRI.src
Param
Process Process #######################################
FUNAUTDLV XAUTDLV XAUTDLV2~XTR # CALPFM entry point in process TRTVENPRICE
# to add costs to sales margin calculation
FUNAUTCFM XAUTCFM $ACTION
MFGBENCH XMFGBENCH Case ACTION
When "CALPFM" : Gosub CALPFM
TRTVENPRI XVENPRI Endcase
Return

#######################################
$CALPFM
# Add postage cost (specific field in SORDERQ table) to cost price
PRI += [F:SOQ]XPOSCOST
Return

• 45 • TEC202- Sage X3 Development Course - Advanced


LAB7: Entry points

Exercise : Using an Entry Point

EXERCICES

46 TEC202- Sage X3 Development Course - Advanced


2.4 - Reports

• 47 • TEC202- Sage X3 Development Course - Advanced


2.4 – Reports

Reports

Additional specific developments may be triggered when running an


Sage X3 report, before the Crystal Reports file is run, using the
following items:

Global report actions

Parameter entry actions

Report initial process

• 48 • TEC202- Sage X3 Development Course - Advanced


2.4 – Reports

Report Actions
Global report actions:

OUVRE Start of report process


Parameter window displayed

EXEC After parameter entry


User presses Print button
IMPRIME(NBPAR, PARAM) Before report is executed (Called as a subprogram)
Crystal Reports file is run
FIN After report execution

For each report parameter:

INIPAR Initialisation (Before start value entry)


Start value entered
CONT1 After start value entry
INIPAR2 Before entering end value
End value entered
CONT2 After end value entry

• 49 • TEC202- Sage X3 Development Course - Advanced


2.4 – Reports

The Initial Process


Initial processes

When a complicated report requires the designing a complicated Crystal Report


file with heavy print-time computing (joins, formulas, code…), it is possible to
replace this with an initial process that will transfer the load to the application.

The initial process performs all necessary computations before the Crystal
Reports file is executed and stores the result in a temporary printing table.

The Crystal Reports file then bases its data on that table and links to other tables
as necessary.

Existing Sage X3 print tables: AREPORTM, MFGPRN…

The report initial process may also be used to update Sage X3 information
before the report is executed.

• 50 • TEC202- Sage X3 Development Course - Advanced


LAB8: Reports

Exercise 1: Tracing print parameters


Exercise 2: Printing reports twice

EXERCICES

51 TEC202- Sage X3 Development Course - Advanced


2.5 – Imports And Exports

• 52 • TEC202- Sage X3 Development Course - Advanced


2.5 – Imports And Exports

A Refresher on Imports And Exports

Introduction to Sage X3 Imports/Exports

Imports and exports are based on templates that define file structure, table joins and field
structure.

Import templates may be based on an object, in which case the import process simulates
manual user entry: As a consequence, interactive business rules and controls are executed.
All field actions are executed for each field, except for those that have been
defined as Interactive Only (Screen dictionary)
Object actions are executed
Non-entered fields are not imported
Mandatory fields must be present in the import data.

Import/export actions may be written in a special process attached to the template via the
two fields:
Standard Process
Specific Process

• 53 • TEC202- Sage X3 Development Course - Advanced


2.5 – Imports And Exports

How Imports Work

[F] = Record to be imported

File Reading
[M] = Existing record
(If record already exists)

System reads table and initialises screens with existing record.


System reads import file and fills [F] class with new values.

[M] = [F]
Entry Simulation

System simulates manual entry with field actions and object actions.

Database transaction
Transaction

Rewrite [F]

Data is written
to object

• 54 • TEC202- Sage X3 Development Course - Advanced


2.5 – Imports And Exports

Import Actions

Import actions:
System Code
Action Sequence

OUVRE When import template + file is opened


IMP_OUVRE Equivalent of object OUVRE action
[F] = Record read in import file
AP_IMPORT After import file record has been read and loaded
(IMP_+) SETBOUT
(IMP_+) RAZCRE
Manual entry simulation [M] = [F]
(IMP_+) VERIF_CRE
trbegin

(IMP_+) INICRE After [F] class has been loaded [F] = [M]
Transaction
Database

(IMP_+) CREATION After Write statement Write [F]

APRES_CRE After database transaction commit

(IMP_)+ FERME

• 55 • TEC202- Sage X3 Development Course - Advanced


2.5 – Imports And Exports

Global Variables

Global variables

GIMPORT
Set to 1 during import, 0 otherwise
Used in field actions and object actions to enable or disable code according
to context

GIMP(n)
This variable is used to declare dummy fields in import and export
templates, that may then be replaced by values computed by the
import/export process.
The field is declared in the template using syntax *n where n is an integer
between 1 and 99 (Example: SPL standard template)
During imports, the corresponding value is loaded into GIMP(n).
During exports, the value stored in GIMP(n) (populated by code) will be
written to the export file in the corresponding slot.

• 56 • TEC202- Sage X3 Development Course - Advanced


2.6 – General Parameters

• 57 • TEC202- Sage X3 Development Course - Advanced


2.6 – General Parameters

General Parameters

Parameter value definition

General parameter values may be defined in the Development / Data / Parameter Definition function.

They must be placed in a new chapter starting with X, Y or Z.


Parameter chapters are defined in miscellaneous table 901.

A global variable may be attached to a parameter value, in which case it is automatically loaded at login.

For parameter values defined on the company, site or user level, the following subprograms may be used
to load the parameter value according to context:
Call PARAM(SITE, PARAM, VAL) From ADOVAL
Value Char SITE Company or site (empty if folder level)
Value Char PARAM Parameter name
Variable Char VAL Value to return

Call PARAMUTIL(PARAM, VAL, USER, SITE) From SUBAUS


Value Char PARAM Parameter name
Variable Char VAL Value to return
Value Char USER User
Value Char SITE Site

• 58 • TEC202- Sage X3 Development Course - Advanced


Contents

1. Other Development Templates


1.1 – The Action Dictionary
1.2 – Window Entry
1.3 – Standard Process
1.4 – Inquiries
1.5 – Other Templates

2. Advanced Programming
2.1 – Left Browsers
2.2 – Entry Transactions
2.3 – Entry Points
2.4 – Reports
2.5 – Imports And Exports
2.6 – General Parameters

3. Development Tools
3.1 – Patches
3.2 – The Development Toolkit

• 59 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

• 60 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patches

A patch is an archive file containing a group of Sage X3 Objects in a


flat and universal form: Application code, Screens, Tables,
execution of a utility program etc. They are applied to a system’s
Folders.

A patch may be used to extract and transfer objects from one Sage
X3 system or Folder to another system or Folder.

A patch may also contain data, as long as the volume is not too
large.

• 61 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patch Creation
Patches are created by specifying a file path, an origin Folder and a list of
objects to include in the flat file.

An Activity Code may be attached to the patch. In that case elements which are
protected by that Activity Code in the destination folder will be overwritten
(Protection is overridden for that Activity Code).

The minimum version prevents patches from being integrated on Folders with a
version lower than the specified value.
In this function, versions are simple sequential numbers spanning several major Sage X3
versions, e.g. 31 for version 6.1 or 32 for version 6.2

Patch elements are identified by a code that points to the type of element, and
by their name in the Sage X3 dictionary, or by a special selection criterion.

It is possible to preload into the patch all elements in the origin Folder that are
flagged with the activity codes specified in the Activity Codes section.

• 62 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patch Elements
Code Object Name Comments
Table Definition (Dictionary) ATB Table_Code Structure only. The table is revalidated.
Table (Data) TAB Table_Code Data and structure. The table is not revalidated.
Partial table contents Table Abrev. Where Clause This transfers partial table contents into the patch. The Where Clause is a valid selection expression.
Screen Definition (Dictionary) AMK Screen_Code
Object Definition (Dictionary) AOB Object_Code
Window AWI Window_Code
Function AFC Function_Code
Action ACT Action_Code
Inquiry ACN Inquiry_Code
Data Type ATY Data_Type_Code
Local Menu AML Menu_Number Patched in the languages specified in the Patch Creation screen.
Misc. Table Parameters ADV Misc_Table_Num.
Miscellaneous Table ADI Misc_Table_Num.
Message Chapter AST Number
Recurring task ABA Recur_Task_name
Batch task ABT Batch_task_code
Global variable AGB Global_var_code
BI fact tables ABF Fact_table_code
BI dimension tables ABI Dimension_code

• 63 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patch Elements
Code Object Name Comments
Activity Code ACV Activity_Code Definition only is transferred if the Activity Code already exists in the destination Folder.
Import/Export Template AOE Template_Code
Parameter Definition ADP Parameter_Code
Process (source) TRT Program_Name
Process (p-code) ADX Program_Name
Process Execution EXE Program_Name Program will be executed at the point where it is located in the patch.
Report Definition (Dictionary) ARP Report_Name
Crystal Report File ETA Report_Name From Report directory on the server.
Text File TXT File_Name From TXT directory on the server.
Entry Transaction ATN Transaction_Code
Purge/History Formulae AHI Formula_Code
Process Dictionary description ADC Process_Code
Navigation Parameter ANG Navigation_Code
Queries ALH Query_Code Definition only is transferred if the Activity Code already exists in the destination Folder.
SQL Queries ALQ SQL_Query_Code
Graphical Queries ALT Grap_Query_Code
Dashboard Views APV Dash_view_code

• 64 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Different types of patches

Standard
This is the most commonly used patch type, even for vertical/custom development.

Supervisor
This type is used when to patch the supervisor folder only, in order to create folders that will
inherit the patched items.

Specific
Same as standard
When patching a screen, it will erase the SPE actions on fields not present in the patch.

Vertical
Same as standard
When patching a screen, it will erase the SPV actions on fields not present in the patch.

Add-on
Dedicated to Add-on. It allows keeping the SPV and SPE actions on fields not listed in the
patch.

• 65 TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Automatic Patch Creation

Automatic Patch Creation is used to automatically generate patches that contain


all the elements that have been modified in a specified period.
Elements to include may be filtered according to:
Start and End Modification Dates
Element types
Activity Code.

Selected elements are listed by Element Type and viewed by drilling in.
The Automatic Patch Generation function will generate a simple Patch header
(empty patch) that may be reloaded in the Patch Creation function for fine-
tuning. If the ‘Direct Generation’ checkbox is ticked, it will directly generate a full
patch.

• 66 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Standard Patches

Sage X3 versions are numbered over 3 digits (X.Y.Z)


X: Major product generation (1 for the moment)
Y: Major version
Z: Release number

Version upgrade (From X.Y1.Z to X.Y2.Z) may be done only by installing the new version.
Release upgrade (From X.Y.Z1 to X.Y.Z2) may be performed using either of the following
methods:
Installation of the new release
Integration of standard patches corresponding to the new release.

Standard Sage X3 patches are numbered 1 to N for each major version (X.Y). They are
strictly chronological.
Correspondences between release numbers and patches is described in the html
documents shipped with all Sage X3 standard patches.
Standard patches must be installed sequentially. For a given version, to install patch N, all
N-i patches have to be already integrated.

• 67 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patch Name Standardisation

When a patch name is standardised, the system will verify that patches are sequential
and will generate a warning message if:
A patch or a set of patches is missing in the chronological sequence
A patch has already been integrated.
Names are standardised in the following way:
XX_NNNNN_VVV.dat <-> PX_06923_160

XX is ‘P’+ a letter identifying the product, e.g. ‘PX’ for Sage X3.
NNNNN is the patch number, e.g. 06923
VVV is the version, e.g 160

When a patch has a standardised name, the system will check, for all patches with the
same X and the same version VVV, that the last patch that was integrated was NNNN-1
For specific patches :
<SPE/SPV_Id>_<PatchNumber>_<X3RequiredPatchLevel>_<X3Version>.dat

• 68 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Patch Integration

The Patch Integration function reintegrates the data and elements


in the destination folders.
A list of Folders to patch must be provided. Standard patches must
usually be integrated on all folders of an environment to maintain
system coherence, as some elements will be diffused only to the
reference folder but not to application folders (e.g. standard
processes).
The Test Folder is an exception to this recommendation. It is used
to test patch integration on an ‘isolated’ folder where all standard
elements will be integrated locally.

• 69 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Integration Rules
Processes contained in the patch obey a special integration rule:

Standard processes are integrated only in the reference folder and in test folders (Test Folder tick
box ticked in the Folder parameters). This allows a test folder to act as an ‘isolated’ environment for
patch testing (By integrating patches only on that folder).

Specific processes are integrated in a specific folder if it exists (Specific Folder tick box is ticked in
the folder parameters) and in all folders where they already exist.
Standard
Standard Patch
Patch
X3
X3 SUBBPC.adx
SUBBPC.adx
Reference
Reference Folder
Folder
Integrate
Integrate in
in Folders:
Folders:
-- X3
X3
-- LIVE
LIVE
-- DEV
DEV
-- TEST
TEST
Specific
Specific Patch
Patch
SPESOH.adx
SPESOH.adx LIVE
LIVE DEV
DEV TEST
TEST
Production
Production Folder
Folder Development
Development Test
Test Folder
Folder
Folder Standard
Standard Patch
Patch
Folder
Integrate
Integrate in
in Folders:
Folders:
Specific Folder Test Folder SUBBPC.adx
SUBBPC.adx
-- X3
X3
-- LIVE
LIVE
DEV SPESOH.adx
SPESOH.adx Integrate
-- DEV Integrate in
in Folders:
Folders:
-- TEST
TEST -- TEST
TEST

• 70 • TEC202- Sage X3 Development Course - Advanced


3.1 – Patches

Execution of processes after patching

Type EXE allows the execution of process after patching.

SUBGTC Validates all Inquiry screens


 
SUBxxx Validates all entry transaction where xxx= transaction object code

SUBASY Validates styles


 
SUBAMI Validates all transactions
 
SUBPS2 Validates all stats

• 71 • TEC202- Sage X3 Development Course - Advanced


3.2 – The Development Toolkit

• 72 • TEC202- Sage X3 Development Course - Advanced


3.2 – The Development Toolkit

Dictionary Validation

The dictionary validation function (Development / Utilities /


Dictionary / Validation) revalidates dictionary elements:
Tables
Screens
Inquiries
Windows
Objects

With filters based on:


Object codes
Modules
Activity codes
Data Types

• 73 • TEC202- Sage X3 Development Course - Advanced


3.2 – The Development Toolkit

Dictionary Copy

The dictionary copy function (Development / Utilities / Dictionary /


Dictionary Copy) duplicates dictionary elements from one folder to
another:
Tables
Screens
Objects
- etc

With filters based on:


Modules

• 74 • TEC202- Sage X3 Development Course - Advanced


3.2 – The Development Toolkit

Other Utilities
Transaction Generation (Development / Utilities / Dictionary /
Transaction Generation):
Revalidates all entry transactions defined in the folder, with filters based on
modules and entry transaction types.

Search functions (Development / Utilities / Searches):


Activity Codes: Lists all elements linked to a given activity code.
Data Types: List all table and screen fields linked to a given data type.
Message: Searches for a text in the local menus (Messages) and returns the
chapters/text numbers.

Database Mass Update (Development / Processes / Database


Mass Update)
Allows mass update transactions to be defined on a single table or a set of
joined tables. Generates the code that will update the tables, with transaction
management including locks/retries.

• 75 • TEC202- Sage X3 Development Course - Advanced


3.2 – The Development Toolkit

GTEST and GPOINTTRA


Display the actions (events/labels) called during the execution
sigma (GTEST=2,1,1) to activate
sigma (GTEST=0,-1,-1) to deactivate

Display the entry points available during the execution.


sigma (GPOINTTRA=2,1,1) to activate
sigma (GPOINTTRA=0,-1,-1) to deactivate

• 76 • TEC202- Sage X3 Development Course - Advanced


THANK YOU

• 77 • TEC202- Sage X3 Development Course - Advanced

You might also like