TEC202 Advanced Development Slides
TEC202 Advanced Development Slides
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
Course Map
• TEC202- Sage X3 Development Course - Advanced
2
Objectives
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
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
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)
OPTIONAL:
Exercise 1.2: Bespoke Dictionary Action
EXERCICES
Window Entry
Simple Complex
Left
Browser
(Possible)
Ok
Ok End
End Ok
Ok End
End
Window Entry
Definition of a Window Entry action in the dictionary (Ex. from CPTBATCH, Journal Status
Monitor)
Action Dictionary
Action
Action CPTBATCH
CPTBATCH
Window
Window FBATCH
FBATCH
Header Screen
Ok
Ok End
End
CPTBATCH
CPTBATCH
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
End of template
FIN End of Window Entry function template
EXERCICES
Standard Process
First Entry
Window
Processing
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
Main Window
Trace File
Criteria Window Transaction Description Validation
DOSWWW
DOSWWW
Standard Process
Common Actions
Batch Mode
User submits batch job
OUVRE_BATCH Batch job submission (Validation button)
INIT_DIA Before initial criteria window is opened (Batch job submission)
EXERCICES
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 …
…
Inquiry Definition
Detail screen(s)
Main Window
Process
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
Inquiry Validation
Inquiry Validation
Inquiry Dictionary
Inquiry Screens
Inquiry code XXX
WWCNSXXX
Specific Process
(Must be written)
CNSXXXSPE
Read/Display Logic
Customisation
Produces a variant of the Inquiry detail window that may be selected by end
users
Inquiry Actions
Inquiry actions
AP_MAGNETO After searching for the corresponding record (Previous, next etc.)
EXERCICES
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
Extra:
BOUT_TABLE After user clicks on a paging arrow (Up/Down)
EXERCICES
Actions:
SEL_LISTE Before selection window is displayed
Selection window displayed
EXERCICES
Miscellaneous Template
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
Left Browsers
Additional Left browsers may be added to an object. They may take several
forms:
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.
Simple Browsers
Hierarchical Browsers
Examples:
Sites (Parameters / General Structure / Sites)
Reports (Development / Processes / Reports / Report Dictionary)
Recursive Lists
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.
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.
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
#######################################
$FILTRE
# If "FOR" transaction, display foreign customers only
If GFLAG = "FOR"
FILTSUP = "BPCCRY <> 'FRA'"
Endif
Return
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.
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
EXERCICES
Reports
Report Actions
Global report actions:
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.
The report initial process may also be used to update Sage X3 information
before the report is executed.
EXERCICES
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
File Reading
[M] = Existing record
(If record already exists)
[M] = [F]
Entry Simulation
System simulates manual entry with field actions and object actions.
Database transaction
Transaction
Rewrite [F]
Data is written
to object
Import Actions
Import actions:
System Code
Action Sequence
(IMP_+) INICRE After [F] class has been loaded [F] = [M]
Transaction
Database
(IMP_)+ FERME
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.
General Parameters
General parameter values may be defined in the Development / Data / Parameter Definition function.
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
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
Patches
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.
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.
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
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
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.
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.
Standard Patches
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.
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
Patch Integration
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
Dictionary Validation
Dictionary Copy
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.