Representations
Classic Function | Function code | GESASW |
---|
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:
Header | General | Properties | Methods | Organization | Displayed properties | Links | Menus |
Additional information:
Global links available on the class management page | Errors list | Additional comments |
Contains information to identify the class:
A unique identification of the representation. It is used to generate automatic script names by the supervisor layer when a validation is performed.
The description of the representation.
Describes the main information about the representation. The following blocks are available in this section:
Defines the class associated with the representation. The class code is mandatory.
Defines the name of the property that identifies the class instance in the representation.
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.
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.
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.
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.
It indicates the technical module the representation is associated with.
Defines the type of device the representation has been created for. The available values are Desktop and Mobile phone.
Reserved for supervisor use and must not be selected for a normal representation.
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.
Defines generic behaviors that are managed for the representation. The following table shows a list of built-in links with a dedicated logic:
Action description | Presence on facets | Prototype characteristics | Comments | ||||||
---|---|---|---|---|---|---|---|---|---|
Action | Link label | Target facet | Query | Detail | Edit | Link | Media Type | Target | |
Display detail | Display | $details | ✔ | $details | JSON | self | |||
List display | List | $query | ✔ | $query | JSON | self | |||
Summary display | Summary | $summary | ✔ | $summary | JSON | popup | |||
Create a record | Create | $edit | ✔ | $create | JSON | self | |||
Quick edit | Modification of a quety line | $edit on a restricted list of fields | ✔ | $edit | JSON | self (in a section that opens) | |||
Duplicate a record | Duplicate | $edit | ✔ | $duplicate | JSON | self | |||
Update a record | Update | $edit | ✔ | $edit | JSON | self | |||
Delete a record | Supprimer | $result | ✔ | $delete | JSON | self | $result=message | ||
Display in Excel | Excel | $details | ✔ | $excel | Excel | Excel | |||
List in Excel | Excel | $query | ✔ | $excel | Excel | Excel | |||
List in PDF | PDF print | $query | ✔ | blank | |||||
Display in PDF | PDF print | $details | ✔ | blank | |||||
Mail merge in Word | Mailmerge | $query | ✔ | ✔ | $wordmailmerge | Word | Wordmailmerge | ||
List in Word | Word | $query | ✔ | $word | Word | Word | |||
Display in Word | Word | $details | ✔ | $word | Word | Word | |||
Back | Back | ✔ | $back |
In addition, the built-in links in the $edit facet are the following:
Action | Link label | Target facet | Target |
---|---|---|---|
Selection | Selection | $lookup | popup |
Creation | Creation | $edit | blank |
Navigation (tunnel) | $detail | blank |
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:
This is a code that identifies the collection:
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 of the collection.
Indicates how the property array is first allocated in memory instances. It can be 0, 1 or Maximum.
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.
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.
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).
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.
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:
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.
Can be Standard, Vertical or Specific:
Select here the processes dictionary.
The order in which the $METHODS or $PROPERTIES labels are called in the event.
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.
Describes the properties defined at the representation level. Properties defined at the class level must not be listed.
This table defines the property list with the following information:
The name of the property as it will be used in the Sage X3 script.
This is an indicative order rank.
Describes the property in the UI.
A short description of the property. It can be used for personalization when designing the UI.
A data type associated with the property. This refers to the data type dictionary. This field is mandatory.
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.
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.
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.
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.
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.
When the data type is a clob or blob managed by the supervisor, this information displays the content type associated with the data type.
If Mandat is set to Yes, then the field can be valid only if a value is present.
Refers to a control table that is used to perform additional consistency control defined through a simple setup.
It defines a property that is used when the control table depends on another table.
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.
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.
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.
Is the code of each parameter. It is presented in display-only mode.
Is the description of each parameter. It is presented in display-only mode.
It defines how the parameter is transmitted in the call. It is presented in display-only mode. It can be:
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.
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.
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:
Is the column name of each segment key. It is presented in display-only mode.
Is the description of each segment key. It is presented in display-only mode.
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.
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.
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:
Gives the list of methods with the following information on every line:
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.
Describes the method.
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.
Allows disabling a method by assigning an activity code. At implementation time, if the activity code is not active, the method is not available.
Gives the list of parameters associated with the current method in the previous grid, with the following information on every line:
Is the name of the variable containing the parameter value, as it can be seen in the code called by the $METHODS event.
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.
Is the description of the variable.
Defines how the parameter is transmitted in the call. It can be:
Defines if the sent parameter is an array and indicates its first index value. It can be:
Available only if the type is Instance
. It defines the class of which the parameter is an instance of.
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:
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:
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.
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.
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.
This defines the default block where the property is located in the user interface.
This is the input order for the property entry in the blocks. Ranks can be discontinued and have up to four digits.
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.
Indicate in which column you want the property to be.
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.
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.
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.
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.
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:
This section defines links that are available in various places of the user interface to trigger operations or methods according to the context.
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.
A link is attached to an element of the interface. It can be attached to:
A property. The anchor name is the property alias. It is directly near the property value. This type of link is related to the property. It enables to:
A collection line. The anchor name is the collection name. An icon is present at the beginning of the line to give access to the links. Usually, this type of link triggers an operation that applies to the entire line.
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.
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.
This grid contains the details of the existing links filtered according to the type and given anchor. The following information is available:
Defines the anchor in which the link is placed. The anchor is empty for Page or Record links.
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:
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.
Modifiable only for generated links. Set to No if you want to deactivate the link.
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.
Corresponds to the text describing the link. It is a translatable text.
It states what is executed when the link is triggered. The different types of links and their characteristics are as follows:
The action selected can only be one compatible with the behaviors supported by the representation.
If the behavior is working on a given record, the key has to figure on the key grid. For example, for Display details or Display Summary, while no key is expected when the Create a new record behavior is defined on the line. This type of link can't be called on an edit facet.
A method is triggered when clicking this link. As it is related to a given context, a method can only be called on an edit facet. The instance that the method operates on and the method name have to be selected. Only the instances available on the line can be considered.
If the instance name is empty, the operating method is the representation method. Otherwise, the instance path must be provided.
An operation is triggered by clicking this link. The instance and the operation name must be provided as well. For an operation, additional information is provided in the Asynchronous column. If set to Yes, a dedicated session executes asynchronously. Otherwise, the user executes the operation and waits for its completion. Dedicated methods are available to handle asynchronous operations. They are described in this document.
A version 6 function page is opened in Classic mode using this link. The version 6 function name must be provided.
A link defined by its URL is opened by clicking this link. The URL must be provided.
Report execution is launched when clicking this link. This kind of link is only possible on a query facet if defined at Record level, or on a Detail facet defined at Record level or Page level.
The report code must then be entered. It refers to a Crystal Report definition defined in the GESARP function. If a redirection has been established for the report through the GESARX function (print code), it is used. This allows associating by a single setup a report code either to a report, a query, an SQL query, an export template, or a business object report. If several codes are associated with the same report code, a popup window opens to select the report to be printed. But in all the cases, a report code must exist otherwise it isn't possible to input it.
The associated action code can be Print or Print Direct. When Print Direct is selected, the report's parameters can't be modified. This type is also used to filter the list of reports available for a given report code.
Once the report has been chosen, the parameter list of the record is displayed in the parameter grid, and it becomes possible to enter path values from the representation to fill the parameter values. They can be single values or expressed as a range.
Note that this kind of execution uses classic mode functions.
Enter this choice only for a representation link to define the code of the used representation.
This describes the action available for the type of link. The choice depends on the type of link:
This choice can be entered only for a Representation link. It can have the following values:
This field describes the path on which methods or operations operate. If empty, it is the representation instance by itself.
This field displays the class code associated with the previous instance path.
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.
This field defines if an operation is asynchronously executed or not. It can be entered only for Operation links.
Enter the code of the classic function associated with the link. You only need to do this for this type of link.
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
Enter the report code to be printed for Crystal Report links.
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.
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.
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:
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.
This field allows to protect a specific link or to deactivate the link. It behaves like all the activity codes.
These check boxes define the facets in which the link is available. The check boxes must be selected to make the link available.
This section defines menus that organize the global link section.
Two tables are present in this section.
The first table provides, on every line, a menu definition with the following information:
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.
Only links other than the usual CRUD and automatic links (PDF rendering, Offices integration, and so forth) are described.
Performs a validation on the representation:
The generated program must not be modified. It is automatically recreated at each validation.
Performs a global validation on the representation:
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:
Icons | Use 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: | Tables | property:description -table_code[abbreviation] Classclass_name[cardinality] | |
Collections | [dimensions]property_nameproperty_description | ||
Scripts | RankType (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.
This section provides the error messages that can occur when using class management.
A collection or a property that has been used in a link is no longer available in the representation.
A generated link has a replacement link that is self-generated.
A replacement link must be consistent with the link it replaces (same anchor and anchor type).
A replacement link must be in the active status.
This message can appear in several cases:
The wrong type has been used.
The code entered does not correspond to a method of the class.
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.