Add a Subtype Record
When you want to add a subtype record to a GE Object, you can do so via the JavaScript API.
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
Â
Know the Name of the subtype Entity.
// In this example, we'll add a Company relationship to our Person, so we want the PersonCompanies subtype. var subTypeName = "PersonCompanies";
Get the subtype collection and call add() on it. Asynchronously set the values of the new record.
Create and Populate a New Subtype Recordvar personGESubTypes = personGE.subTypes; var personCompanySubType = personGESubTypes.findByName(subTypeName);  // add() takes care creating the new GE and setting framework fields // like ID, the ID of the parent record, and Sequence. // Don't try to set them yourself. personCompanySubType.add(function (personCompanyGE) { personCompanyGE.CompanyID = 9; });  // Don't save the subtype record directly; instead, save the parent GE.
Related articles
Copyright © 2014-2019 Aptify - Confidential and Proprietary