Skip to main content
Kinetic Community

Entry

The ArsModels Entry class represents a record in Remedy.  An Entry instance stores field values for each of the fields loaded with the entry as well as the form the record is from.

Entry instances are generally not created manually, they will be returned from the create, retrieve, update, and delete methods called on a Form instance.

Instance Methods

ars_entry Returns the com.bmc.arsys.api.Entry instance that is stored internally with the ArsModels Entry instance.
context Returns the ArsModels Context instance that is associated with the Entry.  If the Entry was returned by a create, retrieve, update, or delete call on a Form instance this context will be the one that was already associated with the form.
form Returns the ArsModels Form instance that is associated with the Entry.  If the Entry was returned by a create, retrieve, update, or delete call on a Form instance it will store an association to that form.
update_attributes!

Updates the record in Remedy that the ArsModels Entry represents and returns the updated instance of the Entry.

This method takes one parameter, a Hash that maps field identifiers (names or ids) to the corresponding values these fields should be set to.

entry.update_attributes!("SortOrder" => newSortOrder)
save! Updates the record in Remedy that the ArsModels Entry represents and returns the updated instance of the Entry.  This will save the changes made to the Entry by the set_field_value or []= methods shown below.
delete! Deletes the record in Remedy that the ArsModels Entry represents.
field_values

Returns a Hash that represents the field values associated to the Entry.  See the Field Values page for more details about how these are handled by ArsModels.

This method takes one parameter, :id or :name which specifies whether the keys of the hash will be field names or field ids.  It will default to field ids if this parameter is omitted.

Get a map of field ids to values

entry.field_values(:id)

Get a map of field names to values

entry.field_values(:name)
to_h Returns a Hash that represents the field values associated to the Entry.  This hash maps field names to field values.  See the Field Values page for more details about how these are handled by ArsModels.
field_value_ids Returns an Array of field ids for the field values that are associated to the Entry.
get_field_value, []

Returns a field value for a given field.

This method takes one parameter, a string or number identifying which field value to return.  If given a string it will assume field name if given a number it will assume field id.  See the Field Values page for more details about how these are handled by ArsModels.

When using the [] method the parameter will actually be placed within the [] characters.

Get a field value using get_field_value

entry.get_field_value("Full Name")

Get a field value using []

entry["Full Name"]
set_field_value, []=

Sets a field value for a given field.

This method takes two parameters.  The first is a string or number identifying which field value to set.  If string it will assume field name if number it will assume field id.  The second parameter is the value to set the field to.  See the Field Values page for more details about how these are handled by ArsModels.

When using the [] method the first parameter will be placed within the [] characters and the second parameter will be placed on the right side of the = (similar to an assignment operation).

Set a field value using set_field_value

entry.set_field_value("First Name", "Bob")

Set a field value using []=

entry["First Name"] = "Bob"
modified_attributes Returns a hash of field values that were modified since the record was last retrieved from Remedy.  To persist the modifications to the Remedy record, the save! method can be used.  The modified attributes will be cleared after a save until new modifications are made.