Text templates
In addition to the manual entry of long texts in the Sales line and the storage of extended descriptions in the master data (for items, catalog items and resources), text templates can be freely defined. They can also be used as automatic defaults for pre- and post-texts in Sales documents. Text templates already contain formatted text that can be adapted or extended as required.
Create and edit text templates
In the Text Templates page, these can be created and customized and their use can be controlled by defining filters. The Area is used as a default for the scope of application of the text templates, as the Table ID and any table filters are preset here. Basically, the areas Sales, Sales Quote, Sales Order, Item, Resource, Catalog Item and User-defined are provided, whereby the master data related areas Item, Resource and Catalog Item are hidden by default. When selecting a text template, the table ID is automatically filtered depending on the context.
In addition to the Table ID, the use of the text template can be restricted via Table Filters. To do this, the Filter action is used to open a filter page matching the table, in which the desired table filters are defined.
The Contents action is used to access the actual content of a text template. This can consist of several texts, e.g. to map several languages. In addition, a validity period (via Starting Date and Ending Date) of a content can be defined here. Content can also be opened via the Contents Count field on the Text Templates page.
The validity period of a content is optional. If nothing is specified here, it is not subject to a time limit. However, several validity periods can be defined, e.g. for different content of the same text template at certain times.
The respective text is entered or edited with the Edit Text action. This is done using the editor from DYCE Happy Texts.
It is only necessary to specify a language code for the content of a text template if the content is only to be entered or valid for a specific language. If no language code is specified, the content is valid for all languages.
Select a text template
In addition to the table ID, other table filters are also taken into account when the user manually selects suitable text templates. If several text templates are found after applying these filters, they are displayed in the order of the text template Code.
Use of placeholders
Placeholders can generally be used in all text templates. However, some places are more predestined than others, e.g. the Header Text of a Sales Quote or Order. They represent text content that is substituted in one of the following steps (see Time of substitution):
- The placeholder is replaced the moment the template is applied.
- The placeholder is replaced during output (e.g. printing/PDF).
Placeholders can control automatic numbering or call functions that generate text content. They can also represent system variables (such as the current date or user ID) or references to fields from the current record or from a referencing table. References to fields can be quite complex. For example, a call from the Sales Header can reference the salesperson's email address using the salesperson code assigned there.
Time of substitution
Whether the substitution of a placeholder takes place when a text template is called or only when the text is output is controlled by the use of curly or square brackets.
Placeholder in curly brackets
Placeholders in curly brackets (e.g. {TIME}) are typically only (pre-)defined in text templates. If the template is used, e.g. automatically inserted as Header Text, such placeholders are immediately substituted. The placeholder is therefore replaced by the actual content when the template is inserted.
- Placeholders in square brackets
The contents of placeholders in square brackets (e.g. [TIME]) are only determined at the time of output, so that the current value is output.
Fields are to be referenced in the Header Text of a Sales Quote. The current table is therefore the Sales Header (table 36).
- Example 1: {@152} shows the date for how long the quote is valid (field Quote Valid To Date)
- Example 2: {@2} outputs the number of the Customer who receives the products (field Customer No. or Sell-to Customer No.)
Variables as placeholders
System variables and the asterisk can be used as variables for placeholders. The placeholder {*} triggers automatic numbering. The following system variables are also substituted:
System variable | is determined as |
---|---|
* | non-numbered listing |
TODAY | Current system date |
TIME | Current system time |
WORKDATE | The workdate set by the user |
CURRENTDATETIME | Current system date/time |
USERID | User ID of the logged in user |
COMPANYNAME | Name of the company |
Reference to the field of another table
A reference can also be used to retrieve data from a field in another table based on the current record. To uniquely define the record in the target table, its primary key is required, among other things. The expression consists of three sections: First, the remote table is referenced, followed by the field to be returned and the primary key of this table.
Schematic structure: {<@remote_table>;<field_in_remote_table>{<@primary_key_of_remote_table>}}
String | Explanation |
---|---|
remote_table | the number of the table that can be determined using the Page Inspection, specified with leading @ |
field_in_remote_table | the field number that can be determined using the Page Inspection, specified without leading @ |
primary_key_of_remote_table | the primary key of the referenced table, specified with leading @ |
Note: If the key is made up of several fields, these are listed separated by comma.
Fields are to be referenced in the Header Text of a Sales Quote. The current table is therefore the Sales Header (table 36).
- Example 1: Output telephone number of the salesperson
Exemplary: [<@SalesPerson/Purchaser>;<Phone No.>;[@<Code>]]
Actual: [@13;5053;[@43]]
Based on the table Sales Header (table 36), field Salesperson Code (field 43), the Phone No. (field 5053) is determined from the table Salesperson/Purchaser (table 13).
Note: The telephone number is only replaced during output. - Example 2: Get name of invoice recipient
Exemplary: {<@Customer>;<Name>;{@<Bill-to Customer No.>}}
Actual: {@18;2;{@4}}
The name of the invoice recipient is retrieved from the Name field (field 2) of the Customer (table 18). The primary key under which the customer is found is determined from field Bill-to Customer No. (field 4) of the current record of the table Sales Header (table 36).
Note: The invoice recipient is replaced directly when the text template is applied.
Functions as placeholders
Functions can also be used as placeholders. The return value of the function is then inserted as text. Functions can be specified as placeholders in the following way: {#FUNCTIONNAME(PARAMETER 1,PARAMETER 2,...)}
String | Erläuterung |
---|---|
FUNCTIONNAME | Name of the desired function |
PARAMETER(S) | the parameters required to execute the function |
Attention: There must be no spaces between the list of parameters!
There is currently only one function available which replaces the salutation. The function #ContactSalutation(ContactNumber,Type) is used to determine the salutation of a contact, for example. The ContactNumber parameter references the desired contact for the salutation, while the Type parameter controls the definition of the type of salutation. The values For, Inf and Int are permitted for formal, informal and internal salutations.
In all examples, the Sales Header (table 36) is used as the current table.
- Example 1: {#ContactSalutation({@5052},For)}
The function determines the formal salutation for Sell-to Contact No. (field 5052) from the current record. Please ensure that a formal salutation exists for the language code used in the contact. Otherwise, no formal salutation can be found in the documents and an error will occur. - Example 2: {#ContactSalutation({@5052},Inf)}
This function call returns the informal salutation. Please ensure that an informal salutation exists for the language code used in the contact. Otherwise, no informal salutation can be found in the documents and an error will occur.