Representations

Classic FunctionFunction codeGESASW

A representation is the description of a data structure dedicated to the user interface. A representation is always associated with a class. In this capacity, it can have its elements such as properties, associated scripts, operations, and methods. These specific elements, added to those already owned by the associated class, support the user interface behavior related rules. An overview of the representation concept is described in the Developer Guide Representations document.

This workbench functionality enables users to create representations and update them. It feeds dictionary tables and generates code by validating representations. A representation already described in the dictionary is not qualified as usable by the software unless it is validated.

To create or update a representation, it is necessary to enter information in several sections:

HeaderGeneralPropertiesMethodsOrganizationDisplayed propertiesLinksMenus

Additional information:

Global links available on the class management pageErrors listAdditional comments

Header information

Contains information to identify the class:

Representation code

A unique identification of the representation. It is used to generate automatic script names by the supervisor layer when a validation is performed.

Description

The description of the representation.

General section

Describes the main information about the representation. The following blocks are available in this section:

General

Class code

Defines the class associated with the representation. The class code is mandatory.

Instance

Defines the name of the property that identifies the class instance in the representation.

Used for search results

When this check box is selected, the representation is selected by default to display the data detail by using the link on the search result page. For a given class and a given type, only one representation can be selected.

Functions

Authorization

This information is optional. It allows the supervisor to check if the access is authorized to a user. The user profile defines for every user the functions that are allowed and can filter by company and sites.

Warning: Make sure that if the function is not filled, the representation is available without restrictions to all users with access to the endpoint. If you want to allow the administration users to filter data for users, a function code must be given. This means that you might have to create a fictitious version 6 function code if the authorization doesn't derive from the access on a given version 6 function, and even a fictitious object if you want to control the access by companies or sites.

Convergence

This information is not mandatory. It defines the Sage X3 version 6 function invoked in Classic mode when the user modifies a record in $detail mode while a $edit facet has not been specified for the representation.

Characteristics

Activity code

Used to protect specific representations during the standard patching process (if starting by X, Y, or Z), or to make them optional. It behaves as all activity codes defined in dictionaries.

Module

It indicates the technical module the representation is associated with.

Type

Type

Defines the type of device the representation has been created for. The available values are Desktop and Mobile phone.

System

Reserved for supervisor use and must not be selected for a normal representation.

Facets

This grid defines the list of facets supported by this representation. The available facets are Detail, Edit, Query, Lookup, and Summary. The check boxes are only displayed according to the behaviors that have been selected.

Managed behaviors

Defines generic behaviors that are managed for the representation. The following table shows a list of built-in links with a dedicated logic:

Action descriptionPresence on facetsPrototype characteristicsComments
ActionLink labelTarget facetQueryDetailEditLinkMedia TypeTarget
Display detailDisplay$details$detailsJSONself
List displayList$query$queryJSONself
Summary displaySummary$summary$summaryJSONpopup
Create a recordCreate$edit$createJSONself
Quick editModification of a quety line$edit on a restricted list of fields$editJSONself (in a section that opens)
Duplicate a recordDuplicate$edit$duplicateJSONself
Update a recordUpdate$edit$editJSONself
Delete a recordSupprimer$result$deleteJSONself$result=message
Display in ExcelExcel$details$excelExcelExcel
List in ExcelExcel$query$excelExcelExcel
List in PDFPDF print$query$pdfPDFblank
Display in PDFPDF print$details$pdfPDFblank
Mail merge in WordMailmerge$query$wordmailmergeWordWordmailmerge
List in WordWord$query$wordWordWord
Display in WordWord$details$wordWordWord
BackBack$back

In addition, the built-in links in the $edit facet are the following:

ActionLink labelTarget facetTarget
SelectionSelection$lookuppopup
CreationCreation$editblank
Navigation (tunnel)$detailblank

Collections

Describes the collections defined at the representation level. The collections that have been defined in the class should be declared if one of the following conditions is fulfilled:

The following information must be entered in the grid:

Code

This is a code that identifies the collection:

Alias

This is a single name that identifies the collection. For a representation collection, the alias is the same as the collection name, and can't be changed. It must be defined when a class path has been given and must be unique for the representation.

Description

Description of the collection.

Min no.

Indicates how the property array is first allocated in memory instances. It can be 0, 1 or Maximum.

Act

Activity code. If assigned, it must be a sizing activity code. This allows defining the maximum dimension of the collection according to the value of the activity code. As the memory allocation is now dynamic, it is no longer useful to optimize the memory spent to store documents during processing.

Max no.

Is the maximum dimension of the collection. It can be entered only if no activity code is present on the collection or it can be kept empty. The collection size automatically grows without limit when new lines are created.

Sequence number

Refers to a property of the representation that stores the number of lines created in the collection. It is used when the number of lines of a document is stored in the header (used in version 6).

Insertion, Deletion, Sort, Addition

If these check boxes are selected then line insertion, deletion and sorting operations are possible on the collection. The check box values have the same value in representation if the collection has been defined in the class. You can clear the check box at the class level, but you can't select the check box if the operation is not supported at the class level.

The corresponding methods are ADDLINE, ADELLINE, and ASORT. ADDLINE is also used for the addition of lines.

Scripts

List of scripts in which $PROPERTIES and $METHODS labels are available for development partners who are prepared to add their code associated with supervisor events (especially for CRUD management). See the event description for more information about the available events.

The following columns are available in this table:

Script

Name of the script. The standard naming convention is repr_Ryyyy where:

As a script can be shared by different classes, the naming convention is not mandatory.

Type

Can be Standard, Vertical or Specific:

File

Select here the processes dictionary.

Order

The order in which the $METHODS or $PROPERTIES labels are called in the event.

Activity code

Used to protect the script during the standard patching process (if starting with X, Y, or Z), and to activate/deactivate the call of the script.

Properties section

Describes the properties defined at the representation level. Properties defined at the class level must not be listed.

Property table

This table defines the property list with the following information:

Property

The name of the property as it will be used in the Sage X3 script.

Order

This is an indicative order rank.

Description

Describes the property in the UI.

Short description

A short description of the property. It can be used for personalization when designing the UI.

Type

A data type associated with the property. This refers to the data type dictionary. This field is mandatory.

Menu

Useful only if the M data type is used. It links to a numbered list that defines all available values for the property. For example, figure 1 corresponds to the No/Yes local menu.

Length

Used when the data type does not determine the length. It can be either a number of characters for string values or a number of digits in N.M format, where N is the number of digits before the decimal position and M is the number of decimals.

Act

Used to protect specific property in standard classes during the standard patching process (type if starting with X, Y, or Z), or to make them optional depending on the activity code value given when configuring the Sage X3 folder. It behaves as all activity codes defined in dictionaries.

Collection

Is empty if the property is a single one. Otherwise, it refers to one of the collections defined in the first section of the class dictionary. It might then be either an array of child references (header/lines structure) or a denormalized array stored in several columns of a database.

Lob table and Lob field

When the data type is a clob or blob managed by the supervisor, this information indicates the table and column where the rich media element is stored. Depending on the table used, the key section will be filled so that the join can be done by giving the value of the key. If the data type is not managed by the supervisor, a program will handle the join and therefore, no information can be entered in these two fields.

Content type

When the data type is a clob or blob managed by the supervisor, this information displays the content type associated with the data type.

Mandat

If Mandat is set to Yes, then the field can be valid only if a value is present.

Control table

Refers to a control table that is used to perform additional consistency control defined through a simple setup.

Dependency

It defines a property that is used when the control table depends on another table.

Access code

Refers to an access code that controls access to the property for a given user based on a setup. See Access code for more information.

GET accessor

If the check box is activated, a GET accessor calling code will be generated on the property. Otherwise, no code will be generated.

This value can be changed at any time in the dictionary, even in specific developments on standard classes. Once activated, it will not be deactivated by any patch at any time.

It is recommended to activate this check box only on properties where it is necessary since calling GET accessors on every property reduces performances when running.

Parameters table

This section describes the current line on the property table. If the property type has rules requiring additional parameters, the parameter list appears in this grid. Therefore, entering a value is required to call the rule with the right parameters according to the context.

Code

Is the code of each parameter. It is presented in display-only mode.

Description

Is the description of each parameter. It is presented in display-only mode.

Method

It defines how the parameter is transmitted in the call. It is presented in display-only mode. It can be:

Type

Is the data type of each segment key. It can be any of the following: Char, Integer, Decimal, Date, Enum, Clbfile, Blbfile, Instance. Uuident, or Datetime. It is presented in display-only mode.

Value

Is the formula behind the value assigned for the parameter. Only a subset of the Sage X3 scripting language is used for the formula. The rules are given in the Developer Guide Restricted Formula for Key and Parameter Values document.

Keys table

This section describes the current line on the property table. If the property type is linked to a table (version 6 technology) or a persistent class (version 7), the key components appear:

Code

Is the column name of each segment key. It is presented in display-only mode.

Description

Is the description of each segment key. It is presented in display-only mode.

Type

Is the data type of each segment key. It can be any of the following: Char, Integer, Decimal, Date, Enum, Uuident, or Datetime. It is presented in display-only mode.

Value

Is the formula behind the value assigned to a key segment. If the key is made of several segments, every segment description is usually a property of the class (and frequently the current property). But when a multiple segment key is defined, some elements can be additional properties or constants. Only a subset of the Sage X3 scripting language is used for the formula. The rules are given in the Developer Guide Restricted Formula for Key and Parameter Values document.

Methods section

Defines the methods for the representation. As the representation is linked to an UI process, only stateful methods are available. Thus, being stateless, operations can only be defined for classes.

The following information is available in this section:

Methods table

Gives the list of methods with the following information on every line:

Code

Identifies the method name that can be called for the representation. Upon running, the ACTION variable has this code as a value when the corresponding event is executed within the $METHOD label of the representation associated source files.

Description

Describes the method.

Return

Is the data type of the value returned by the method when called by Fmet. This is the type of the ARET_VALUE variable available in the event associated with the method. It can be any of the following: Integer, Date, Char, Decimal, Clbfile, or Blbfile.

Activity code

Allows disabling a method by assigning an activity code. At implementation time, if the activity code is not active, the method is not available.

Parameters table

Gives the list of parameters associated with the current method in the previous grid, with the following information on every line:

Code

Is the name of the variable containing the parameter value, as it can be seen in the code called by the $METHODS event.

Type

Is the data type of the parameter sent to the method. It refers to the keyword used for the variable declaration. It can be any of the following: Char, Integer, Decimal, Date, Enum, Clbfile, Blbfile, Instance, Uuident, or Datetime.

Description

Is the description of the variable.

Method

Defines how the parameter is transmitted in the call. It can be:

Dim.

Defines if the sent parameter is an array and indicates its first index value. It can be:

Class

Available only if the type is Instance. It defines the class of which the parameter is an instance of.

Organization

This section specifies the default hierarchical organization that is set up for the representation, as well as additional information used for the query page. A representation defines:

Sections, blocks, and fields are placed by default on a page with a predefined algorithm. The [personalization functions](../ui-definition/personalization.md) enable a user to change the layout without losing the hierarchical organization of the representation.In this section, the following information can be found:## Sections tableRefers to the list of sections for the page. The following information must be entered:### CodeThis code must be unique for a representation. It can have up to twelve upper case characters or digits.### DescriptionThis label is displayed on the page. It is mandatory.### Display orderThis number gives the default input order of the sections. The rank can be discontinuous and can have up to four digits.### StackedSet to Yes if you want the entire screen to be arranged in stacked mode.### Activity codeIt is used to protect specific sections during the standard patching process (if starting with X, Y, or Z), or to make them optional. It behaves like all activity codes defined in dictionaries.## Blocks tableRefers to the list of blocks for the page. The following information must be entered:### CodeThis code must be unique for a representation. It can have up to twelve upper case characters or digits.### DescriptionThis label is displayed on the page. It is mandatory.### SectionIndicates the section in which the block is located.### Display orderThis number gives the default input order of the sections in the block. The rank may be discontinued and can have up to four digits.### StackedSet to Yes if you want the block to be arranged in stacked mode.### Column no.Indicate if you want the block to be on column 1 or 2.### Activity codeUsed to protect specific blocks during the standard patching process (if starting with X, Y, or Z), or to make them optional. It behaves as all activity codes defined in dictionaries.## Filters tableStates the list of filters that can be used for the current representation. The filters present in this list are used in the query facet. A filter set as mandatory is always applied to the query.Other filters are displayed as links on the right side of the page. Clicking such a link refreshes the query by applying the corresponding filter in addition to the mandatory one if it exists. No combination of filters is done when clicking several links: the new filter set replaces the previous one.If there is at least one filter that is not mandatory in the grid, an additional link called no filter is also present to allow the user to query a list with no other filter than the default one. When entering the query, the filter that has the default check box selected applies by default, but it can be replaced by any other filter.The following information is found in the filter table:### CodeIdentifies the filter, must be unique. A selection action is available on this field to select a filter defined at the class level.### ClassThis check box is display-only. When selected, it indicates that the filter has been set at the class level.### DescriptionThis translatable dictionary text corresponds to the label displayed for the filtering link present on the page.### Activity codeIf selected, it indicates that the link is optional. It is present only if the activity code value is set to Yes. If starting with X, Y, or Z, it indicates that the link is not standard.### MandatoryOne filter at most can be defined as mandatory. This filter is always used and can be combined with one of the other filters listed in the grid.### DefaultOne filter at most can be defined as default. This filter is applied by default when using the representation where it is present in the corresponding list of links. However, the user can select another filter by right-clicking on the related link.### Option conditionDefines the condition applied when the filter is set. It is a logical expression that can include operators, class properties, and constants.### Error messageThis message is displayed when a filter has been set and an attempt to access a record that does not fulfill the filter conditions is made.## Sort orderThis section allows defining the default order used to display the query lines. If not filled, the default index for the main table associated with the class is used.### IndexAllows entering a default index used for the query. This index can only be one of the indexes present on the main table associated with the class.### Index descriptorThis information can only be entered if no default index has been defined. A sorting description can be defined here on fields that are present in the query facet with the usual syntax of keys, for instance:-FIELD1+FIELD2-FIELD3+FIELD4When such a syntax is used, the sorting order is by FIELD1 in descending mode, then by FIELD2 in ascending mode, then by FIELD3 in descending mode, finally by FIELD4 in ascending mode.This corresponds to the &OrderBy=FIELD1 Desc;FIELD2;FIELD3 Desc;FIELD4 additional variable in the URL.# Displayed propertiesA representation displays on the device a list of properties that can be:

The properties table lists all the available properties. It can be filled in with a right-click action. A window appears for the user to choose among different classes and child classes as well as the properties to be included. It is always possible to enter into a property in a line.

The information present in this table is as follows:

Alias

This name must be unique in the representation. It is used to designate the property in the data feed exchanged with the client. It can be up to 30 characters long. The first character must be an upper case letter while the others should include upper case letters, digits, or underscore characters. No lower case letters are allowed in the alias.

Property

This defines the path of the property, with the dot path syntax, which means:

The segments in the path are the child instances codes as they are defined in the representation or class description.

Collection

If this field is filled, the property is part of the collection that can be:

The dot path syntax is used to define the collection path, for example:
SORDER.LINE.QTY is the path for a collection in the ORDERLINE child class (LINE instance) of the SALESORDER class (SORDER instance) associated with the representation.

When a collection is present on a representation, the properties within it are displayed in the user interface as a table. The collection is presented as a list if there is only one member in it.

The properties present in a collection must be ordered sequentially and in the same block. This means that a property can integrate a block only if it belongs to the corresponding collection. An unrelated property, whether it is independent or present in another collection, can't be included among properties of a particular collection.

Block

This defines the default block where the property is located in the user interface.

Order

This is the input order for the property entry in the blocks. Ranks can be discontinued and have up to four digits.

Description, Short description

This indicates the label that can be used in the user interface. The defined label, its presence, and position can be changed in the personalization mode.

Column no.

Indicate in which column you want the property to be.

Activity code

Use this activity code to make the property optional. It automatically disappears from the prototype if the activity code is innactive. It protects the property's characteristics if it is a specific activity code.

Unit

If the property is a numeric value attached to a unit, such as a quantity and an amount for a currency, the property defining the unit used must be set. It has to be one of the properties of the representation. Only a property having a data type attached to a table that manages units can be selected.

Filter P

If this check box is selected, the corresponding value constitutes a filter when invoking the query facet. For example, if the following case happens:

To filter on US country sales orders, the user selects the following option in the URL that calls the SORDER representation in query mode:

...?url=http://myserver:8124/x3/$$prod/DEMO/SORDER?representation=SORDER.$query&where=COUNTRY_ORDER eq 'US'

Some characters should have been avoided.

It is not necessary to select this check box for all the properties of the query facet because the possibility to filter on the column values is implicit for them. The filter line allows entering values directly.

Entry P

If this check box is selected, the corresponding value can be a filter whenever the edit or detail facet is called. This is important if one of the parameters is not present in the key.

Query, Detail, Edit, Lookup, Summary

These columns represent the different facets in which the property can be used. When one of these columns is selected, the property is present in the corresponding facet. Otherwise, it is not.

Following every facet column, there is an Initial status that can be Visible or Invisible. It can be set differently for each facet. This status can be changed afterward by a development partner with a script using an ASETATTRIBUTE method.

For the Edit column:

Links

This section defines links that are available in various places of the user interface to trigger operations or methods according to the context.

Filter

As the number of links in a representation can be high, the section presents a restricted list of the available links based on the following filters:

Generated links are inherited from the data type. They should not be modified. They can be deactivated if they aren't necessary. They can be replaced by other links. This is useful for links that need to be different from the default ones. For example, in a selection or a zoom.

Some links may not work anymore when a patch changes the structure of a representation. For instance, by deleting some of its properties. To keep the representation working despite this effect, links are marked as invalid. To fix this situation, invalid links must be validated again.

Description of the anchor type and its associated name

A link is attached to an element of the interface. It can be attached to:

Parameters table

This grid is filled with the parameter list when a link requires additional parameters to operate. The corresponding values need to be defined. For example, when a method requires an additional parameter.

Keys table

This grid is filled with the corresponding components when a link requires a key to operate. The value is filled with formulas. For example, for an operation operating on a class. Only a subset of the Sage X3 script language is used for the formula entered. The rules are provided in the Developer Guide Restricted Formula for Key and Parameter Values document.

Links table

This grid contains the details of the existing links filtered according to the type and given anchor. The following information is available:

Anchor

Defines the anchor in which the link is placed. The anchor is empty for Page or Record links.

Code

Identifies the link. For a given anchor, only one link with a given name must exist. Dedicated codes exist for the standard links, for example:

Generated

This check box can't be modified. It is set when the link is inherited from a data type. The characteristics of the link can't be changed but it can be deactivated or replaced by another link.

Active link

Modifiable only for generated links. Set to No if you want to deactivate the link.

Invalid

This check box can't be modified because it is set when the link can't be used due to the lack of some parameters on the corresponding facet. This may happen after installing a maintenance patch. A validation attempt generates a log detailing the issues. You can select the Only invalid links check box to display only the links concerned by this issue.

You need to address this issue to fix the link. Otherwise, it is not used.

Description

Corresponds to the text describing the link. It is a translatable text.

Type

It states what is executed when the link is triggered. The different types of links and their characteristics are as follows:

Representation

Enter this choice only for a representation link to define the code of the used representation.

Action

This describes the action available for the type of link. The choice depends on the type of link:

Target

This choice can be entered only for a Representation link. It can have the following values:

Instance path

This field describes the path on which methods or operations operate. If empty, it is the representation instance by itself.

Class code

This field displays the class code associated with the previous instance path.

Method/Operation

You have to enter the operation or method to be called when a link has this type. Only the method or operation available on the class associated with the instance path can be used.

Asynchronous

This field defines if an operation is asynchronously executed or not. It can be entered only for Operation links.

Function

Enter the code of the classic function associated with the link. You only need to do this for this type of link.

URL

You have to enter the URL associated with the Free type links. This URL can either be:

An URL link can include variables that are known on the current page. The syntax is {NAME}, where NAME is the name of the alias defined in the Displayed properties section. For example, if:

The link to display a map can be https://maps.google.com/maps?q={LINE1}+{LINE2}+{LINE3}+{POSCOD}+{CITY}&t=k

Report

Enter the report code to be printed for Crystal Report links.

Menu

For Page or Record links, you can create a hierarchy of menus in the Menu section. This field defines the menu the link is attached to. If it is empty, then the operation is attached to the first level.

Order

This defines the sorting order for the links in the menu hierarchies.
Note: Enter a value different than zero to see the link in a mobile representation.

Attribute

This information describes how the link appears on the UI. Its exact interaction depends on the type of device (mobile, tablet, or workstation). An attribute can have the following values:

Replacement

The purpose of this function is to replace the default link. The default link is manually created by an automatically generated one. Replacement is operational only on a generated link where a user indicates in the corresponding field the code of the manually created link (a.k.a. non-generated link) to be replaced. Both generated and non-generated links involved in a replacement operation should have the same type and anchor. A generated link can be deactivated if it isn't necessary.

Activity code

This field allows to protect a specific link or to deactivate the link. It behaves like all the activity codes.

Detail, Query, Edit, Lookup, Summary

These check boxes define the facets in which the link is available. The check boxes must be selected to make the link available.

Menus

This section defines menus that organize the global link section.

Two tables are present in this section.

Menu

The first table provides, on every line, a menu definition with the following information:

Default configuration

This table allows you to define the default links that are presented for every facet in the first position with a dedicated style on the global link panel. The only information to enter is the link or menu code and activity code. The other information is displayed.

Global links available in the Representations function.

Only links other than the usual CRUD and automatic links (PDF rendering, Offices integration, and so forth) are described.

Validation

Performs a validation on the representation:

The generated program must not be modified. It is automatically recreated at each validation.

Options > Global validation

Performs a global validation on the representation:

Tree structure

This link also exists in the class dictionary. It displays a graphical view of the class or the representation. The displayed view looks like this picture (partial view based on a company class):

This view gives you the detailed list of collections, tables, children classes, scripts. The icons used are described in the following table:

IconsUse case and information displayed
Representation (node followed by the elements of the representation).
Class that has children elements (scripts, tables, collections or classes: this node followed by the embedded element list).
Table managed (node followed by a list of tables).
Collection of class instances or including several property collections (node followed by a list of classes or arrays).
Scripts list: this node followed by the corresponding scripts.
Elements that don't have additional children details:Tablesproperty:description -table_code[abbreviation] Classclass_name[cardinality]
Collections[dimensions]property_nameproperty_description
ScriptsRankType (Standard, Vertical, Specific)Script name
Class that has no children elements.
Recursive class (ie. reference to a class that has already been described in the hierarchy).

At the bottom of the window, an array gives the list of the elements with the following information: level, class, parent class, collection, cardinality.

The total number of children class embedded in the class or the representation is displayed, as well as the maximum depth of the hierarchy.

Notes:

  1. When collections or arrays of references are given, they can be given in the following formats:
  2. The cardinality of a relation is defined with one of these choices:

Errors list

This section provides the error messages that can occur when using class management.

Anchor xxx link yyy : Property or collection does not exist

A collection or a property that has been used in a link is no longer available in the representation.

Anchor xxx link yyy : The zzz replacement link must not be generated

A generated link has a replacement link that is self-generated.

Anchor xxx link yyy : The zzz replacement link must correspond to the same type and action that ttt

A replacement link must be consistent with the link it replaces (same anchor and anchor type).

Anchor xxx link yyy : The zzz replacement link must be active

A replacement link must be in the active status.

Anchor xxx link yyy : Link zzz not allowed on facet fff

This message can appear in several cases:

Anchor xxx link yyy : This method is / is not an operation

The wrong type has been used.

Anchor xxx link yyy : The method does not exist

The code entered does not correspond to a method of the class.

Additional comments

Note that modifications done on the representation might have an impact on other representations that have a link on a facet of this representation.

This explains why entering the dictionary on a representation can trigger an automatic update on the links. A message is displayed when this happens, and the user is invited to save the updated representation. The link on the representations is also automatically done when a patch is installed or the folder is revalidated.