Record Title: Configuration
For data entry and maintenance forms, the record title includes the values of key fields by default. If you need to adjust the automatically defined record title, you can use one of the following approaches:
- Use the headerDescription decorator (recommended)
- Implement the ICaptionable interface in the graph of the form
Using the headerDescription Decorator
To define a record title, in the view class that corresponds to the primary view of the graph, you need to add the headerDescription decorator to every field whose value should be specified in the record title. For details on defining view classes, see View Classes in TypeScript.
The decorator is applicable to any field in the primary view.
For example, the record title for the Shipments
(SO302000) form is composed of the following values: Shipment Nbr.
(the ShipmentNbr
field, which is the key field of the form) and
Customer (the CustomerID
field). To define the
record title, the headerDescription decorator is added to the
CustomerID
field in the definition of the view class, as shown in the
following code.
export class SOShipmentHeader extends PXView {
ShipmentNbr: PXFieldState;
@headerDescription
CustomerID: PXFieldState<PXFieldOptions.CommitChanges>;
...
}
ShipmentNbr
in the example above) because the key fields are
added to the record title by default.Depending on which fields are marked with the headerDescription decorator, the record title is composed according to the following rules:
- If no field is marked with the
headerDescription
decorator, the record title is received from the server. If the server does not send the record title or sends information that it should be empty, the record title is composed of the set of key fields of the view and the description of the last key field if this description exists. - If only the non-key fields are marked with the
headerDescription
decorator, the record title is composed of the key fields of the view and the description of the fields marked with theheaderDescription
decorator. - If only the key fields are marked with the
headerDescription
decorator, the record title is composed of these key fields and the description of the last key field, regardless of whether it is marked with theheaderDescription
decorator. - If both the key fields and the non-key fields are marked with the
headerDescription
decorator, the record title is composed based on these fields.
You can specify how a field is shown in the record title by specifying the parameter of the
headerDescription
decorator on this field. For details, see Enumeration HeaderDescription.