Professional Documents
Culture Documents
Exercises level 2
Reference: X3DVP2v7.1p5EXMSA1.0
22 01 2014
© Sage 2015
This document is the exclusive property of Sage and/or all of the Sage Group affiliates and is
protected by the Intellectual property Code, copyright laws and international treaties.
Any partial or total reproduction of this document is strictly prohibited.
Anyone not complying with these provisions shall be guilty of copyright infringement and will
be liable to criminal penalties provided by the law.
Page 2 of 25
Table of contents
1.0 Preamble 4
1.1 Introduction 4
1.2 Audience 4
1.3 Prerequsites 4
1.4 Library management functionalities 4
1.0 Tables 6
1.1 Activity code XX01 6
1.2 Local menus 6201, 6202, 6203 6
1.3 Tables XLMBOOK, XLMMEMBER and XLMLOAN 8
4.0 Representations 15
4.1 Representations 15
4.2 Adding the representation on the UI 18
4.3 Representations Script 21
Page 3 of 25
1.0 Preamble
1.1 Introduction
In order to show you the new way of development on V7, we will create a basic Library
Management System application, as the basic use of a library for ‘borrowing from a
collection’ (i.e. not a ‘programming language’ library) is common to all, whatever one’s
nationality or country.
This document should be used in conjunction with other Sage ERP X3 documentation.
Links to relevant documents containing more detailed instructions on how to develop
Sage ERP X3 with the Syracuse technology are listed in each Where can I find out more?
section.
1.2 Audience
The intention of this document is to assist those with limited knowledge of the Sage ERP
X3 Syracuse platform to develop and implement a simple application in Syracuse using
recommended practices.
Development (Use) cases in the Appendix list development processes common to many
applications that will be used in the development of the basic application.
1.3 Prerequsites
Access to the following tools are required before starting the Library Management System
project:
Example requirements:
Page 4 of 25
As a librarian I want to be able to add/amend members in the Library Management
System.
As a library member I want to be able to renew a book using a mobile device.
As a library member I will need to return borrowed books.
As a user I want a book that does not currently exist in the Library Management
System.
As a developer I want to display warning and error messages to users.
As a developer I want to filter LOOKUP representations.
Page 5 of 25
1.0 Tables
Active: checked
Using the TXT function (Development > Data and parameters > Tables > Local menus -
messages) in the Windows Safe X3 client, create the Local menus, as follows:
Page 6 of 25
Title /
Code Key Field Details
Description
Local menu: Select (yes)
Activity code: XX01
Code. Numeric (incremental)
Message. Genre:
– Action
– Adventure
Library Book – Classics
6201
Genre – Cooking
– Fantasy
– Humour
– Horror
– Mystery
– Poetry
– Romance
– Sci-Fi
– Travel
Local menu: Select (yes)
Activity code: XX01
Code. Numeric (incremental)
Library Book Message. Status:
6202
Status – Available
– On load
– Damaged
– Lost
The business solution will allow the selection of a book’s genre from a list, i.e. from the
local menu (lookup table), when a book is added to, or amended in, the Library
Management System database.
Page 7 of 25
1.3 Tables XLMBOOK, XLMMEMBER and XLMLOAN
Use the GESATB function (Development > Data and parameters > Tables > Tables) in the
Windows Safe X3 client to create the data tables as follows:
Index tab:
– Index code / Index description / Duplicates:
IDBOOK_0 / IDBOOK / No
ISBN_0 / ISBN / No
Page 8 of 25
Created MIDDLENAME / Middle name / A
LASTNAME / Last name / A
DOB / Date of Birth / D
MEMTYPE / Member type / M / 6203
MEMSTATUS / Active / M / 1
ADDRESS / Address / A / Dim. 5
POSTCODE / Postcode / A
CREDATTIM / ADATIM
UPDDATTIM / ADATIM
AUUID / AUUID
CREUSR / AUS / / AUTILIS
UPDUSR / AUS / AUTILIS
Index tab:
– Index code / Index description / Duplicates:
IDMEM_0 / IDMEMBER / No
Columns tab:
– Column / Title / Type / Menu / Link tbl / Mand.:
LOANID / Loan ID / A / / XLMLOAN/ Yes
IDMEMBER / Member ID / A / / XLMEMBER/
Yes
IDBOOK / Book ID / A / / XLMBOOK/ Yes
BORROWDAT / Date borrowed / D
DUEDATE / Date due/ D
RETURNDAT / Date returned / D
Library Book
FINEAMT / Fine amount / DCB
Loan
LOANSTA / M / 1
Page 9 of 25
2.0 Data Classes
Page 10 of 25
ISBN / A
BKGENRE / M / 6201
BKSTATUS / M / 6202
BKPRICE / DCB / / Yes
DDC / A
DATEPUR / D
CREDATTIM / ADATIM
UPDDATTIM / ADATIM
AUUID / AUUID
CREUSR / AUS
UPDUSR / AUS
General tab:
– Collections (add): XCO_ADD, description
“Address”
Set the number of address lines as 1
(minimum) to 5 (maximum). As members
can be added and deleted tick the fields
Insertion, Deletion, Sort and Addition
Properties tab:
– Property / Type / Menu / Collec. / Mand.:
IDMEMBER / A / / Yes
FIRSTNAME / A
Library MIDDLENAME / A
XLMMEMBER
Member LASTNAME / A / / / Yes
MEMTYPE / M / 6203
DOB / D
MEMSTATUS / M / 1
ADDRESS / A / / XCO_ADD
POSTCODE / A
CREDATTIM / ADATIM
UPDDATTIM / ADATIM
AUUID / AUUID
CREUSR / AUS
UPDUSR / AUS
Properties tab:
– Property / Type / Menu / Mandatory:
LOANID / A / / Yes
LOANSTA / M / 1
Library Book IDMEMBER / A / / Yes
XLMLOAN
Loan IDBOOK / A / / Yes
BORROWDAT / D
DUEDATE / D
RETURNDAT / D
FINEAMT / DCB
CREDATTIM / ADATIM
Page 11 of 25
UPDDATTIM / ADATIM
AUUID / AAUID
CREUSR / AUS
UPDUSR / AUS
Type : Reference
Internal type: Alphanumeric
Activity code: XX01
XLMBOOK Library Book
Length: 10
Type Content : ATYPE7
Class: XLMBOOK
Type : Reference
Internal type: Alphanumeric
Activity code: XX01
Library
XLMMEM
Member Length: 10
Type Content : ATYPE7
Class: XLMMEMBER
Type : Reference
Internal type: Alphanumeric
Activity code: XX01
Library Book
XLMLOAN
Loan Length: 10
Type Content: ATYPE7
Class: XLMLOAN
These data types have to be added to the ID fields of your tables, data class.
Page 12 of 25
3.0 Data Classes Scripts
XLMBOOK_CSPE to:
– Display an error if the ISBN entered by the user is less than 10 characters.
o Use the V6 function “len”
o Use the “ASETERROR” method
XLMMEMBER_CSPE to:
– Set the status of a library member (MEMSTATUS) to Active (Yes) when adding a
new member to the database;
o Use the “CST_AYES” variable.
– Set the field Date of birth (DOB) to mandatory if the field Member type (MEMTYPE)
is set to Child.
o Use the ASETATTRIBUTE method
XLMLOAN_CSPE to:
– Automatically set the borrowed date (BORROWDAT) to today’s date;
– Automatically set the loan status (LOANSTA) to yes;
Automatically set the due date of return (DUEDATE) to one week after the borrowed date.
Page 13 of 25
Create two others AXUNIT test to create a loan and a member.
Note: You can write an Eclipse template here, to use it on different classes.
XLMLOAN_CSPE to:
– Set the status of a library book to “On loan” when the book is loaned out;
o Capture an event on XLMLOAN_CSPE
o Instantiate a new book
o Call a XLMBOOK method to update the book
o Create a new method in your XLMBOOK data class
o Use a parameter to read the book
o In this method update your property “BKSTATUS”
o Update your book
– Ensure the loan status of a library book (LOANSTA) is set to Active (Yes) when
adding a new loan record to the database;
Don’t forget to add your method to your method tab in data classes function Source
Page 14 of 25
4.0 Representations
4.1 Representations
Page 15 of 25
XLMBOOK.DATPUR / DETAIL
Tick the field Filter for the following:
IDBOOK, TITLE, BKGENRE, BKSTATUS
Tick the fields Query, Detail, Edit,
Enterable, Lookup and Summary for all
properties.
General tab:
– Class code. XLMMEMBER
– Instance. XLMMEM
– Activity code. XX01
– Search representation. Select (yes)
– Managed behaviors: As members can be
added and deleted tick the fields Create,
Update and Deletion
Organization tab:
– “Section” Block : Code. MEMBER
– “Blocks” Block : Code / Section:
HEADER / MEMBER
DETAILS / MEMBER
Displayed properties tab:
– Property / Block:
XLMMEM.IDMEMBER / HEADER
Library
XLMMEMBER XLMMEM.FIRSTNAME / DETAILS
Member
XLMMEM.MIDDLENAME / DETAILS
XLMMEM.LASTNAME / DETAILS
XLMMEM.MEMTYPE / DETAILS
XLMMEM.DOB / DETAILS
XLMMEM.MEMSTATUS / DETAILS
XLMMEM.ADDRESS / DETAILS
XLMMEM.POSTCODE / DETAILS
XLMMEM.CREDATTIM / DETAILS
XLMMEM.UPDDATTIM / DETAILS
XLMMEM.CREUSR / DETAILS
XLMMEM.UPDUSR / DETAILS
XLMMEM.AUUID / DETAILS
Tick the field Query for the following:
IDMEMBER, FIRSTNAME,
MIDDLENAME, LASTNAME,
MEMSTATUS
Tick the fields Details, Edit and Enterable
for the following:
IDMEMBER, FIRSTNAME,
MIDDLENAME, LASTNAME, MEMTYPE,
DOB, MEMSTATUS, ADDRESS,
Page 16 of 25
POSTCODE
Tick the field Lookup for the following:
IDMEMBER, FIRSTNAME, LASTNAME,
MEMSTATUS
Tick the field Summary for the following:
IDMEMBER
General tab:
– Class code. XLMLOAN
– Instance. XLMLOAN
– Activity code. XX01
– Managed behaviors: As loan records can
be added and amended tick the fields
Create and Update.
Page 17 of 25
XLMLOAN.LOANID / LOAN
XLMLOAN.LOANSTA / LOAN
XLMLOAN.IDMEMBER / DETAILS
XLMLOAN.IDBOOK / DETAILS
XLMLOAN.BORROWDAT / DETAILS
XLMLOAN.DUEDATE / DETAILS
XLMLOAN.RETURNDAT / DETAILS
XLMLOAN.FINEAMT / DETAILS
Tick the field Filter P and Entry P for the
following:
IDMEMBER
Tick the field Query for the following:
LOANID, LOANSTA, IDMEMBER,
IDBOOK, BORROWDAT, DUEDATE,
RETURNDAT
Tick the field Detail for the following:
LOANID, LOANSTA, IDMEMBER,
IDBOOK, BORROWDAT, DUEDATE,
RETURNDAT, FINEAMT
Tick the fields Edit and Enterable for the
following:
LIBYESNO, LOANID, LOANSTA,
IDMEMBER, IDBOOK, BORROWDAT,
DUEDATE
Tick the field Lookup for the following:
LOANID, LOANSTA, IDMEMBER,
IDBOOK
Tick the field Summary for the following:
LOANID
Notes – XLMLOAN
Page 18 of 25
A menu item to allow records for all three key entities (‘books’, ‘members’ and ‘loans’) to
be added and maintained in the ‘library’ is required.
Menu items are created by selecting the Menu Items link in the Administration Syracuse
page displayed on your ‘navigation page’. The Menu Items link displays a query facet
screen with the list of existing menu items.
The process for making a representation class visible in the client is:
2: Create Module
3 : Create sub-module
Your Menu Item code should match the code used for the master data table you
created in exercise 1. For books this will, therefore, be the code XLMBOOK; for
members, the code XLMMEMBER and for loan records, the code XLMLOAN.
Title/
Code Key Field Details
Description
Information block:
– Link type. Must be set to Representation.
Content block:
– Application. X3 ERP
– Endpoint. SEEDCOP folder – Sage ERP
XLMBOOK Library Book
X3 V7 demo folder
and
XLMMEMBER Library – Representation. This field is mandatory
and Member for Representation link types.
XLMLOAN Loan a library
XLMBOOK (Library Book)
book
XLMMEMBER (Library Member)
XLMLOAN (Loan a library book)
– Entity. This field is mandatory for
Representation link types.
Page 19 of 25
XLMBOOK (Library Book)
XLMMEMBER (Library Member)
XLMLOAN (Loan a library book)
– Facet. Query
Where can I find out more?
GitHub Sage-ERP-X3 / dev-doc / Wiki Area: How to guides
Subject: Syracuse Pilot examples
Topics: How to make a class
representation visible in the client
_ You can “Edit” the “Home” navigation and create the modules and sub-modules through
hyperlinks. Less user friendly, but allow to write more information (filter on endpoints)
_ You can use “Edit page content” and create on the same window : modules, sub-
modules, menu item links. Most quickly way to do this, add your new elements with “New”
button or Select with “Select”.
Page 20 of 25
Personalisation the Landing page is done in the “Home” page by clicking on the home
icon
Use the fist tab and add your menu Items by clicking on the adding icon , then click
on representation, search your menu Item through the search field, and finally select
these.
XLMLOAN_RSPE to:
– automatically set the LIBYESNO field to “yes” on creation.
– automatically hide the LOANSTATUS field when the LIBYESNO field is not
checked and display if it is.
Page 21 of 25
5.0 Additional Services
We want to create a trace when a member is loaning a book or modifying it. This trace will
contain the book’s name, date of return and the user who created it.
5.2 Profiling
We want to know how many times take the calling of update function in the script
XLMLOAN_CSPE.
Page 22 of 25
6.0 Results of the Development Processes
Create and amend a library book and library member / Library member loans a book
1. Your new library book, member and loan Menu Items will be displayed as a link in your
selected vignette.
2. When you have selected your Menu Item link a Query facet screen will display as you
have designed (process step 4):
3. Selecting the Create link in the right panel displays an Edit facet screen as you have
designed (process step 3). In the following example screen the Date borrowed and
Date due fields will be set by the script added to the data class (XLMLOAN_CSPE) but
can be amended by either typing in or selecting a different date:
Page 23 of 25
Page 24 of 25
© Sage 2015
This document is the exclusive property of Sage and/or all of the Sage Group affiliates and is
protected by the Intellectual property Code, copyright laws and international treaties.
Any partial or total reproduction of this document is strictly prohibited.
Anyone not complying with these provisions shall be guilty of copyright infringement and will
be liable to criminal penalties provided by the law.
Page 25 of 25