Creates a Unit
const newUnit = unit.addUnit(name, email, contactName, contactAddress, contactPhone, contactEmail);```
Creates a Unit
const pharmacyRepID = unit.addUnit({unitName: 'New Unit'});```
An object of alternate ids for this object, with values as [[AltId]]
// you've marked certain forms with the FID of deprecated and want to filter for those
const warningMessage = baseObject.altIdsObject().FID.value().includes('deprecated') && 'Please use a different form';
An object of alternate ids for this object, with values as strings
// you've marked certain forms with the FID of deprecated and want to filter for those
const warningMessage = baseObject.altIds().FID.includes('deprecated') && 'Please use a different form';
Same as calling optAncestor(var).orElse(null)
If this object is a Collection it returns it as an array. The majority of objects in the system are Collections. For most objects, this is the same as calling [[children]].
const ids = obj.asArray().map(ob => ob);
Get the children of the object. This retrieval goes one level deep.
Optional
classType: string | numberconst childrenNames = obj.children().map(child => child.displayName());
Gets the contact email that is set in Unit Information page.
B.email({
to: unit.contactEmail(),
subject: 'Updates Discussion',
text: 'Please join us for a discussion about upcoming updates being deployed a week from today.',
}).send()
Sets the Organization's contact's email.
Gets the contact name that is set in Unit Information page.
// assumes you have an array of units
Sets the Organization's contact's name.
Deletes this group Entry data, with the option to additionally delete the underlaying entries.
Optional
deleteConnectedEntries: booleanpassing true
will delete all associated entries; default is false
Deletes the group Entry data with the passed id, preserving the underlaying entries
The deleted children of this object. Only looks one level deep. E.g. a form's deleted children could include fields and form entries. A folder's deleted children could include folders, forms, and formulas, but not any of those forms' entries.
const deleted = baseObject.deletedChildren();
The default display name of this object. For the most part, this is the same as calling toString()
, which is the same as inserting the object into a string.
The following assumes you have already aggregated a selection of baseObject
s into an array
const displayNames = [];
for (const o of baseObjects) displayNames.push(o.displayName());
const namesList = `<ul><li>${displayNames.join('</li><li>')}</li></ul>`;
Sets the Display Name.
Gets an array of all the object's ancestors.
const numberOfAncestors = obj.getAncestors().length;
Returns the Local Cache object for this Thread/Base Object.
A [[Java.Optional]] of the ancestor with the specific class.
const ancestors = obj.optAncestor(1000001).ifPresent(a => console.log('${a} exists'));
A [[Java.Optional]] of the current object's parent object.
Optional
classType: string | numberconst ancestors = obj.optAncestor(1000001).ifPresent(a => console.log('${a} found'));
Same as calling optParent(var).orElse(null)
Optional
classType: string | numberGets the primary [[Relate.RecordContainer]] for the Unit. This holds all of the [[Relate.Record]]s for the Unit. It's used, e.g., on the Change Unit page.
const recordContainerId = unit.primaryRecordContainer().id()
Gets the support email that is set in Unit Information page.
B.email({
to: unit.supportEmail(),
subject: 'We have a problem',
text: 'Need your help. Please reply ASAP.',
}).send()
Sets the Organization's Email.
The versions of this object.
const versions = baseObject.versions();
Returns a view URL for this object, if it has one. This value is always a relative URL, meaning it does not contain the protocol prefix or domain name such as http://xyz.bluestep.net
.
const viewBtn = `<button data-href="${baseObject.viewUrl()}">Go to ${baseObject.displayName()}</button>;
Creates a new group entry data object and applies it to a specific unit.
const { request, response } = B.net;
const unitId = "111000___148502";
allRes.currentUnit(unitId);
allRes[0].unit()
.addGroupEntryData({
// id of the 'Group Entry'
groupEntryId: '530101___1',
// ids of all residents affected
recordIds: ['1000002___1154989'],
// key/value pairs where the key is the formula identifier of the field being updated
commonFieldsData: { 'homePhone': '(801) 654-5978' }
});
Applies updates to a group entry data
object. You will get an error if the passed
id is not found and/or if you pass fields that don't exist
const { request, response } = B.net;
const unitId = '111000___148502';
allRes.currentUnit(unitId);
allRes[0].unit()
.updateGroupEntryData({
groupEntryDataId: '530103___701', // id of the 'Group Entry Data'
commonFieldsData: { 'homePhone': '(801) 654-5978' } // key/value pairs
});
Generated using TypeDoc
TODO
Example