Readonly
formsForms are attached to records. A query returns records. Thus, forms
is the accessor to all the forms attached to the records returned by the query. As seen in [[FormMetaDatas]], the forms can be accessed using any of the [[BaseObjectLookup]] methods, including byName
, byId
, and byGID
.
See [[require]] for an example using `forms` inside a loop.
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';
An array of alternate ids for this object.
// 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());
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;
The [[Id]] of this object bounded to T.
const displayDiv = `<div class="object-card" id="${baseObject.id()}">
<div class="title">${baseObject}</div>
<div class="body">Hello World!</div>
</div>;
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 | numberCalling require
off a query adds it to the global namespace as whatever alias you pass into the name
argument. See [[FormMetaData.require]] for similar examples.
When require
is called in imports.js
, it creates a branch of the dependency tree for that object.It's not required to call require
inside of imports.js
, but if you don't, that object won't show up in the inspector.
Optional
name: stringIf empty, defaults to the object's FID (see [[AltId]]).
Get all the formula IDs of a form and camel case them (assumes you have your own toCamelCase
function)
const camelCased = {};
B.queries.byFID['allPeople'].require('allPeople');
for (const {forms} of Object.values(allPeople)) {
for (const formKey in forms) {
const fields = forms[formkey].allFields;
for (const fieldKey in fields) {
const field = fields[fieldKey], camelCased = {};
camelCased[toCamelCase(field.metaData().displayName())] = field.toString();
}
}
}
The [[Id]] or [[AltId]] that the system deems most relevant.
const displayDiv = `<div class="object-card" id="${baseObject.topId()}">
<div class="title">${baseObject}</div>
<div class="body">Hello World!</div>
</div>;
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>;
Generated using TypeDoc
Metadata unique to queries.
QueryMetaData
is accessed via a [[QueryMetaDatas]] accessor (byName
,byId
, etc.), which are an extension of the [[BaseObjectLookup]] methods.