If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Once you have a GE Object, the most common thing you'll want to do with it is access its fields.

This How-To assumes you have already gone through the steps in Get A GE Object and are coding inside of a callback to Aptify.framework.genericEntity.getEntityObject(). It continues that example, assuming you have already defined personGE.

Step-by-step guide

Fields on a GE object can be accessed in two ways: with get()/set() methods or simply by referring to the field as a property of the GE Object.

  1. Via properties:

    Field Access Via Properties
    // Getting a field value
    var name = personGE.FirstLast;
     
    // Setting a field value
    
    personGE.LastName = "Test";
  2. Via accessor methods:

    Field Access
    // Getting a field value
    var company = personGE.get("CompanyName");
     
    // Setting a field value
    personGE.set("Department", "Testing");

 

Field Capitalization

Using the property access is generally advised because it's shorter and clearer.  The advantage of using get() or set() is that you don't have to get the capitalization of the field name right; it's corrected for you.

Field Capitalization
var name = personGE.firstlast; 
// field capitalization is wrong, so name gets the value undefined
 
var name = personGE.get("firstlast"); 
// field capitalization is wrong, but the get() method is smart enough 
// to find the field anyway and name is set correctly
 
personGE.first = "Test"; 
// field capitalization is wrong; a new property on the object, called "first",
// is created with the value "Test", but the person's first name does not actually change
 
personGE.set("first", "Test"); 
// field capitalization is wrong, but the set() method is smart enough to 
// find the field anyway and the person's first name changes to Test

 

Filter by label

There are no items with the selected labels at this time.

  • No labels