Try OpenEdge Now
skip to main content
New Information
Business Entity Support for Data Objects : Handling SERIALIZE-NAME for fields referenced by a JFP
 

Handling SERIALIZE-NAME for fields referenced by a JFP

When you specify the SERIALIZE-NAME option for a temp-table field defined in a Business Entity, the schema for the field specified in the generated Data Service Catalog identifies the field by the alternative name specified using SERIALIZE-NAME instead of the original field name specified in the temp-table definition. For example, consider the following simple temp-table definition with one field:
DEFINE TEMP-TABLE ttCustomer BEFORE-TABLE bttCustomer
FIELD Cust-Num AS INTEGER INITIAL 0 SERIALIZE-NAME "CustNum".
In this temp-table field definition, the field is defined in the generated schema with the alternative name CustNum instead of Cust-Num. You might use this option, for example, to remove the hyphens from field names for clients, such as JavaScript clients, where the hyphen (-) is always interpreted as a minus sign.
In the prior OpenEdge release, without additional annotations, when the client invoked the Read operation for a Kendo UI DataSource, any field defined with SERIALIZE-NAME that appeared in the ablFilter or orderBy property value of its JFP object parameter was identified in these property values using the alternative field name specified by SERIALIZE-NAME instead of its original field name in the temp-table definition.
As a result, using this ablFilter or orderBy property value directly as an ABL search or sort expression returned an unknown field error. In this example, no temp-table (or database) field exists with the name, CustNum. In the prior release, you could avoid this error by including a field-level annotation on the temp-table definition to identify the original field name to return in properties of the JFP object.
In this release, the generated schema for any field defined with SERIALIZE-NAME automatically includes a Catalog property that identifies its original field name without the need for any additional annotations on your part. When a JFP object is returned, its ablFilter and orderBy property values always identify the field by its original temp-table field name, not the alternative name specified by SERIALIZE-NAME.