Clear the [[BaseObject]] from the cache.
// you store time information about each object and want to clear them if they're older than 5 seconds
console.log(objList)
// [{id: id1, timestamp: 1555100262645},{id: id2, timestamp: 1555100277174}]
const cleanupObj = objList => {
const expTime = new Date().getTime() - 5000;
for (const obj of objList) obj.timestamp < expTime && obj.id.clearCache();
}
setInterval(cleanupObj(objList),5000);
// gonna be honest, setInterval doesn't exist in bluestep.js because it's part of the WindowOrWorkerGlobalScope namespace in JS
Get [[BaseObject]] associated with the [[Id]]. Akin to [[B.find]].
Get the global Id, which is defined as an [[AltId]] with the [[AltId.name]] of 'GID'.
// see if any forms' GIDs are overlapping
B.queries.byFID['allUsers'].require();
const gidSet = new Set();
for (const user in allUsers) {
const gid = user.id().globalId();
gidSet.has(gid) ? console.log(`${user} GID is duplicate`) : gidSet.add(gid);
}
Check if [[Id]]s are equal regardless if they are [[AltId]] variations. This is like a double equals whereas [[equals]] is like a triple equals.
Get the [[Id]] object for the organization. Its [[classId]] will be 111111.
An AltId can be assigned to almost every object in the System to aid in generic/human-readable lookups.
System AltIds
The system processes IDs in the following order
require()
off a query or form and pass nothing in, the system will automatically bind it to the context using theFID
, i.e. you don't have to rename a query/form every time you use it in a formula. E.g.FID=nameForm
SID=protected
GID=25001
1000003_U141114__25001
So if you pass in a GID, it will first check if it's an FID or SID, find it's a GID, then not even check to see if it's a UID.
Group IDs
If an AltId key is preceded with an underscore (
_
), it refers to a group of entites. For example, you might have an AltId called_frontDeskReports
with values such asbilling
,clients
, andappointments
. You can callB.findAll('_frontDeskReports')
and get all of them back in an array.See [[B.find]] for an example of finding an object with its AltId.