rbf_setReferenceRecordFieldValue()
Purpose
This function sets the value of a reference field on current page with a given
integration name, objectOriginalId and record ID.
It will run the field's onchange event handler if
there is event handling code attached to that event.
This accepts objectOriginalId of the
applicable objects (selected during reference field creation) only in the reference
record field.
Syntax
rbf_setReferenceRecordFieldValue(fieldName,objectOriginalId,value)
Parameters
fieldName
The integration name of field
objectOriginalId
The original ID of the object.
value
The selected record ID. This is an optional parameter.
If this parameter is null, it sets only the value of the selected object.
Note: This API is not supported in portals.
Example
The following example sets reference record field
Reference_Record value with the objectOriginalIdp4oVeJd8SSWtoLqeGuHZOw and record ID 52974:
<script>
(function () {
rbf_setReferenceRecordFieldValue("Reference_Record","p4oVeJd8SSWtoLqeGuHZOw","52974");
}) ();
</script>