rbv_api.getFieldValue()

Warning: Support for using this method with external objects (such as those mapped to external tables, to OpenEdge Service objects, or through a HDP connection) is a beta feature. This method is supported in production systems, except for external objects.

Purpose

This object script method returns the value of a field from an existing object record. You can access fields using template tokens instead of this method for better performance.

To get integration codes for enumerated values such as picklists and status, append the #code suffix to the fieldName parameter. For example, a fieldName value of status returns a status ID, status#code returns the status code, status#value returns the status display name.

Formulas used in Object Script triggers can include other API methods and regular Platform template functionality, such as loops. Object Script methods have no effect if called outside of update triggers.

Note: Because getFieldValue() acts on existing data, it cannot be used in a validation script, which checks data before storing it.

Syntax

rbv_api.getFieldValue(objName, Id, fieldName)

(or)

rbv_api.getFieldValue(objName, Id, fieldName, langCode)

Parameters

objName

Integration name of object

Id

ID of record

fieldName

Integration name of field to retrieve value from

langCode

A valid two-letter ISO language code. If a user wants to get the language specific value, then provide the langCode.

Return value

Value of requested field

Permissions required

View permission for the selected object type.

Example

  • For regular Platform objects:

    var x = rbv_api.getFieldValue("order", {!id}, "description"); 
  • For regular Platform objects with language specific value:

    var x = rbv_api.getFieldValue("order", {!id}, "description", "es");
  • For objects imported from an external database or OpenEdge Service:

    var x = rbv_api.getFieldValue("order", '{!#UID}', "description");