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]].
Get the children of the object. This retrieval goes one level deep.
Optional
classType: string | numberThe "created at" timestamp of this object.
The creator of this object.
Gets the professial credential (MD, RN, etc.) for the user. Credentials are an optional feature that allow users to append a credential after their signature, such as Dominic Montacello, Esq. Currently requires contacting BlueStep to turn on. Will be accessible at some future time via application of specific [[AltId]]s.
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.
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.
Sets the Display Name.
Gets an array of all the object's ancestors.
Returns whether the user has a given endorsement.
Endoresements are additional classes of security on the system level. For example, you might only want certain users to access endpoints. However, the majority of endorsements (such as GLOBALUSERS, TECH, UBERTECH, and ENGINEER) give high level system access and are only available for super users.
For the time being, endorsements can only be given by a BlueStep employee.
The endorsement you are checking.
Returns whether the user is global or not. There are three primary types of global users
Returns if the user is a global, non reseller user
Returns if the user is a global, reseller user
The [[Instant]] indicating the last time the user interacted with the BlueStep platform. Interaction may include logging in, logging out, expanding/collapsing navigation items, or other system-level activities within the platform.
Returns the Local Cache object for this Thread/Base Object.
Same as calling optLock().orElse(null)
The [[User]] that last modified this object.
A [[Java.Optional]] of the ancestor with the specific class.
A [[Java.Optional]] of the current object's parent object.
Optional
classType: string | numberGets an [[Java.Optional]] of the Relate [[Relate.BaseRecord]] for the user. Optional will be empty if this user object represents a super user.
An [[Optional]] of the [[Relate.Entry]] for the user. Each Record Type has a table in the databse. This method returns the User's row in that table (wrapped in an Optional).
In the standard Relate setup, if you navigate Admin > Record Categories and look at User, you'll see under the "Applies To" column, it says "Individual".That tells you that you can navigate Admin > Record Types > Individual and there see all the fields associated with the record.
Same as calling optParent(var).orElse(null)
Optional
classType: string | numberRetrieves the logged in user's [[Relate.BaseRecord]] [[Id]] if available, else the User [[Id]]. The primary use is for getting a user or super user [[Id]], as super users do not have a [[Relate.BaseRecord]] [[Id]].
When a [[User]] is created, they are first created as a row in the database. This is the [[Relate.BaseRecord]] [[Id]], beginning with 1000201. A facade called [[User]] is then put over the [[Relate.BaseRecord]] to make it easier to work with. This facade is given an [[Id]] beginning with 222222.
Equivalent to user.optEntity().map(e -> e.id()).orElseGet(user.id);
This method returns the recently viewed records. Currently, it will return up to 30 records.When inspecting recent records it is possible to get each record's name, id, unit, record type and current categories. Recent records can be read and manipulated. See also [[Relate.BaseRecord.recentRecords]].
Same as calling optRecord().orElse(null)
. See [[optRecord]] for more info.
Reset the current object so that it is cleared from the cache and looked up from the database.
Gets the [[Unit]] for the user.
Get the most and least populous units in your org. Assumes users
is an object with all users.
const units = {};
for (const {unit} of Object.values(users)) { // deconstruct the value
!units[unit] && (units[unit] = 0); // initialize units[u]
units[unit]++;
}
const values = Object.values(units);
const min = Math.min(...values);
const max = Math.max(...values);
Makes changes to the database for this object
Returns the [[UserData]] object for this user.
Gets the username for the user.
Management has decided that "
, *
, and %
are now illegal username characters
const usersToUpdate = Object.values(users)
.filter(user => user.username.search(/\"|\*|%/) > -1)
if (usersToUpdate.length) B.createAlert({
type: 'auto',
message: 'Username contains illegal characters. Change username.',
users: usersToUpdate
})
The versions of this object.
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
.
Represents a user on the system.