Passing Field Map Information to a Custom JPO

The form field settings contain information about how the system should display the field, where the field get its data, and how to update it.

The JPOs used with the preProcess JPO, cancelProcess JPO and postProcess JPO parameter get the complete form definition from the key formMap.

fieldMap: fieldMap contains the field settings and the field values based on the type of JPO program executing per the settings defined for the field. The table below describes the list of JPO programs used with the settings, which have fieldMap as an argument.

Field Setting Description

program

fieldMap is passed for the JPO program.

All the keys specified in the fieldMap table below are available to the JPO program.

Range Program

fieldMap is passed to the JPO program.

All the keys specified in the fieldMap table below are available to the JPO program.

Update Program

fieldMap is passed to the JPO program.

All the keys specified in the fieldMap table below are available to the JPO program.

URL Parameter Description

postProcessJPO

or

preProcessJPO

or

cancelProcessJPO

formMap is passed to the JPO. The formMap contains the form field information (Map) of all the fields in the form.

The fieldMap of the individual fields can be retrieved from the formMap. All the keys specified in the fieldMap table below are available to the JPO program.

The fieldMap is a key-value pair and the following table describes its sample structure. Depending on the JPO method getting called, the fieldMap key-value pair available will differ.

Key Possible or Sample Values Description

expression_businessobject

relationship[EC Distribution List].to.name

Expression to get the field value from the database

name

ReviewerList

Name of the field

label

emxComponents.Form.Label.ReviewerList

Label given to the field.

Href

URL

Href given to the field.

Settings

Map of all the field settings with the following key-value pairs and the description:

Editable - true - Whether the field can be editable

Field Type - programHTMLOutput - Determines the field value retrieval procedure.

Registered Suite - Components - Application Suite Name

Settings map contains all the information related to the field settings.

This example shows how you can read the field settings of the individual field from the fieldMap.

// Getting the fieldMap
HashMap programMap = (HashMap) JPO.unpackArgs(args);
HashMap fieldMap = (HashMap) programMap.get("fieldMap");
// Getting the first-level key-value pair from fieldMap
String field_expression = (String) fieldMap.get("expression_businessobject");

String fieldName = (String) fieldMap.get("name");

String strLabel = (String) fieldMap.get("label");

//Getting the Settings key-value pair from fieldMap which is inside nested Hashmap
HashMap settingsMap = (HashMap) fieldMap.get("settings");? 

String suiteKey = (String) settingsMap.get("Registered Suite");? 

String fieldType = (String) settingsMap.get("Field Type");