JPO Guidelines for Updating Column Values

You can use this JPO approach for obtaining column values when the column is configured with an update program and update function.

Use this approach for a column with these settings:


  • Update Program=JPO name
  • Update Function=JPO method name

For processing the data, the input parameter may be used by the method. The return type of this method is a Boolean, which is true if the update is successful. The JPO function template looks like this:

public static boolean methodName(Context context, String[] args) 
throws Exception
{
HashMap programMap = (HashMap) JPO.unpackArgs(args);
HashMap paramMap = (String) programMap.get("paramMap");
HashMap requestMap = (String) programMap.get("requestMap");
// Get the required parameter values from "paramMap" - as 
required
String objectId = (String) paramMap.get("objectId ");
String relId = (String) paramMap.get("relId ");
String newValue = (String) paramMap.get("New Value");
String oldValue = (String) paramMap.get("Old Value");
// get languagestr from requestmap
String languageStr = (String) requestMap.get("languageStr");
// Define and add selects if required
// Process the information to set the field values for the 
current object
?.
return 0;
}

See Improving Performance of Table Columns for a sample JPO for getting table column values.

In the JPOs used for updating the Table component fields, the values for the parameters timeZone, charSet, localeObj are returned as String[] objects. The first element of these string arrays contain the parameter values. And the languageStr parameter is returned as a string.