How entities are identified in the system. Can by either system or user assigned. When an ID is system-assigned, it is also referred to as UID. See [[AltId]] for an explanation of FID, SID, GID, and UID.

Regex representation: /[[classId]]_[[u]]?_[[AltId.name]]?_+([[shortId]]|[[AltId.value]])/

e.g. 123456_U123456__1

Example

B.queries.byFID['allUsers'].require();
const userIds = allUsers.map(u => u.id());
explore example
[[B.queries]], [[Relate.QueryMetaDatas.byFID]], [[Relate.QueryMetaData.require]], [[BaseObject.id]]

Type Parameters

Hierarchy

Constructors

Methods

  • Get the class Id. First member in [[Id]]. Of the form /[0-9]{6,7}/ (e.g. 123456).

    Returns number

    Example

    console.log(id.classId()); // '1000001'
    
  • Clear the [[BaseObject]] from the cache.

    Returns void

    Example

    // 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]].

    Returns T

    Example

    const itemCreator = itemId.find().creator().fullName();
    
    explore example
    [[BaseObject.creator]], [[User.fullName]]
  • Get the global Id, which is defined as an [[AltId]] with the [[AltId.name]] of 'GID'.

    Returns string

    Example

    // 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);
    }
    explore example
    [[B.queries]], [[Relate.QueryMetaDatas.byFID]], [[Relate.QueryMetaData.require]], [[User.id]]
  • Check whether an [[Id]] is valid. New Ids with a [[shortId]] of 0 are not valid.

    Returns boolean

    Example

    TODO
    
  • Check whether an [[Id]] is versioned. Will be true if the object has been modified.

    Returns boolean

    Example

    console.log(newObject.isVersioned()); // false
    console.log(existingObject.isVersioned()); // true
  • Get the long Id.

    Returns string

    Example

    console.log(id.longId()); // '1100002_U123456__5'
    
  • 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.

    Parameters

    • otherId: Id<any>

    Returns boolean

    Example

    
    
  • Get the [[Id]] object for the organization. Its [[classId]] will be 111111.

    Returns Id<Organization>

    Example

    const orgId = user.id().orgId() // '111111___141114'
    
  • Get the short Id. Last member of [[Id]]. Comes in many forms.

    Returns string

    Example

    console.log(id.shortId()); // '1100002'
    
  • Returns the standard System ID. That is ClassID___ShortID.

    Returns string

    Example

    
    
  • Get the organization U-identifier. Of the form /U[0-9]{5,6}/ (e.g. U123456).

    Returns string

    Example

    console.log(id.u()); // 'U141114'
    
  • Get the version number of the [[BaseObject]] associated with the [[Id]]. If the object has never been modified, will return 0.

    Returns number

    Example

    console.log(newObject.version()); // 0
    console.log(existingObject.version()); // 12

Generated using TypeDoc