Bluestep JS Documentation
    Preparing search index...

    A relate record with [[Form]] dependencies from a [[Query]]/report.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    forms: { [key: string]: FormEntry }

    [[Form]]s formula dependents for this [[Record]]

    Methods

    • Adds a category by name or by a category object to the current record. The result is a boolean value which is true if the category was successfully added, false if the record already belonged to the category (or it was pending).

      Parameters

      Returns boolean

      TODO
      
    • An object of alternate ids for this object, with values as [[AltId]]

      Returns { [name: string]: AltId<Record> }

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

      Returns { [name: string]: string }

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

      Returns EList<Record>

      // 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)

      Type Parameters

      Parameters

      • classType: string | number

      Returns B

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

      Returns EList<BaseObject<any>>

      const ids = obj.asArray().map(ob => ob);
      
    • A Map of category to boolean values listing all possible categories for the current record. The boolean value indicates if the record will be in the category after pending change are applied.

      Returns Map<BaseObject<any>, boolean>

      TODO
      
    • A object with the category names as members and values as boolean. The boolean value indicates if the record will be in the category after pending change are applied.

      Returns { [key: string]: boolean }

      TODO
      
    • Get the children of the object. This retrieval goes one level deep.

      Parameters

      • OptionalclassType: string | number

      Returns EList<BaseObject<any>>

      const childrenNames = obj.children().map(child => child.displayName());
      
    • The "created at" timestamp of this object.

      Returns Instant

      const createdAt = `<div class="created-at">${baseObject.created()}</div>`;
      
    • The creator of this object.

      Returns User

      alert(`Guess who created this. It was ${baseObject.creator().fullName()}. They are to blame.`);
      
    • 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.

      Returns EList<BaseObject<any>>

      const deleted = baseObject.deletedChildren();
      
    • Deletes the current record. A safer technique is to mark the record as ready for delete, then send yourself an email so you can go look at the record before you delete it.

      WARNING: This really does delete the record. That means it will delete all of the entries from all of the forms belonging to this record, not just the forms the formula is accessing. This action is pretty much irreversable. Don't call this function unless you are 100% certain you are deleting the correct record and that deleting the record is the right thing to do. If in doubt, don't use this method.

      Returns void

      TODO
      
    • Returns a delete URL for this object, else a blank string. Following the URL will delete the object, so proceed with caution.

      Returns string

      const deleteBtn = `<button data-href="${baseObject.deleteUrl()}">Go to ${baseObject.displayName()}</button>;
      
    • 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.

      Returns string

      The following assumes you have already aggregated a selection of baseObjects 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.

      Parameters

      • name: string

      Returns void

    • Document Library URL.

      Returns string

      TODO
      
    • Returns an edit URL for this object, else a blank string.

      Returns string

      const editBtn = `<button data-href="${baseObject.editUrl()}">Go to ${baseObject}</button>`;
      
    • Gets an array of all the object's ancestors.

      Returns EList<BaseObject<any>>

      const numberOfAncestors = obj.getAncestors().length;
      
    • The [[Id]] of this object bounded to T.

      Returns Id<Record>


      const displayDiv = `<div class="object-card" id="${baseObject.id()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • Returns whether the object is locked or not.

      Returns boolean

      Part of the [[Lock]] API.

      const isLocked = baseObject.isLocked();
      
    • returns true if baserecord was or is a user

      Returns boolean

    • Returns whether the object is pending a lock or not.

      Returns boolean

      Part of the [[Lock]] API.

      const isPendingLock = baseObject.isPendingLock();
      
    • Returns whether the object is pending an unlock or not.

      Returns boolean

      Part of the [[Lock]] API.

      const lockPendingUnlock = baseObject.isPendingUnLock();
      
    • returns true if writable

      Returns boolean

    • Returns the Local Cache object for this Thread/Base Object.

      Returns LocalCache

    • Same as calling optLock().orElse(null)

      Returns Lock

    • The modified date of this object.

      Returns Instant

      const isModified = baseObject.modified();
      
    • The [[User]] that last modified this object.

      Returns User

      const modifierName = baseObject.modifier().fullName();
      
    • This method is used to get information about the current record's navigation. Specifically, it gives you an object from which you can traverse the record navigation tree to access information about all of the navigable elements available to the record. The result of getRecordNav(...) is a navigation element object, described below. IMPORTANT: This method is a costly function to execute. Instead, use [[B.find]] or [[Id.find]] to retieve objects. Otherwise wach time this method is executed the system must build the record navigation tree which requires loading and processing the entire Relate structure and potentially loading/processing many of the fields on each form as well. In a large Relate configuration this can literally involve over 100,000 operations and many a seconds processing the formula. On an un-cached organization this function can take over 30 seconds to execute (although, to be fair, record navigation will eventually need to be loaded anyway). Avoid calling this function when possible. Also you might organize your code so this method only needs to be called once, then all navigation elements utilized in one go.

      Parameters

      • Optionalflags: string

      Returns RecordNavItem

      TODO
      
    • Results in a new [[Record]] matching the record type and record categories of the current record. The new record will also be in the [[Unit]] where the current record resides. This method will throw an Error and will not create a new record if there are no writable forms available to populate data into the new record. Note that this function is similar, but not identical, to the [[Query.newRecord]] function. Specifically, there are four important differences.

      1. The new record may have additional categories.
      2. The new record may be in a sub unit.
      3. The new record cannot be retrieved again via the [].
      4. A new [[Record]] will be created even if the [[Query]]/report uses multiple record types.

      Returns Record

    • A [[Java.Optional]] of the ancestor with the specific class.

      Parameters

      • classType: string | number

      Returns Optional<BaseObject<any>>

      const ancestors = obj.optAncestor(1000001).ifPresent(a => console.log('${a} exists'));
      
      explore example
      [[Java.Optional.ifPresent]]
    • Returns the [[Lock]]

      Returns Optional<Lock>

      Part of the [[Lock]] API.

      const lockExpire = baseObject.optLock();
      
    • A [[Java.Optional]] of the current object's parent object.

      Parameters

      • OptionalclassType: string | number

      Returns Optional<BaseObject<any>>

      const ancestors = obj.optAncestor(1000001).ifPresent(a => console.log('${a} found'));
      
      explore example
      [[Java.Optional.ifPresent]]
    • Same as calling optParent(var).orElse(null)

      Type Parameters

      Parameters

      • OptionalclassType: string | number

      Returns B

    • This method returns the recent records to be inspected and modified. When inspecting recent records it is possible to get each record's name, id, unit, record type and current categories. Will throw an Error if the [[BaseRecord]] does not represent a [[User]].Recent records can be read and manipulated. See also [[User.recentRecords]] and [[ObjectB.optRecentRecords]]

      Returns RecentRecords

      TODO
      
    • Locks the current record. The expire value is not required and defaults to one hour for a new lock, or the current expire [[Java.Time.Instant]] for an existing lock. This function results in a String value indicating the version of the current entry. The result may be null if the lock was unsuccessful.

      Parameters

      Returns string

      TODO
      
    • Each Record Type has a table in the databse. This method returns the record's row in that table.

      To see the Record Types, open Relate and navigate Admin > Record Types. Two common types are Individual and Facility. If you click on Individual and scroll down, you'll see a plentitude of fields. In common Relate vernacular, this form is called "Name and Email". Each [[Entry]] on this is a [[Record]] of type Individual, and it's those [[Entry]]s that can be returned by this function.

      Returns Bluestep.Relate.Entry

      TODO
      
    • Removes a category by name or by a category object from the current record. The result is a boolean value which is true if the category was successfully removed, false if the record doesn't belong to the category (or it was pending removal).

      Parameters

      Returns boolean

      TODO
      
    • Reset the current object so that it is cleared from the cache and looked up from the database.

      Returns void

    • Moves the record to the same unit as the data identified by [[Id]] or [[Unit]].

      This is intended to used in conjunction with a relationship field where you select a record belonging to a different unit, and the formula moves the current record to the same unit as the selected record. However, other usages are also possible. Using this technique it is possible to allow users to move records without granting Editor to the record type and thus opening up permission to other more dangerous functions, such as delete record.

      Parameters

      Returns void

      TODO
      
    • A String field containing the relative URL to view and/or edit this entry. This value is always a relative URL meaning it does not contain the protocol, prefix, or domain name such as http://xyzzy.bluestep.net.

      Returns string

      TODO
      
    • The [[Id]] or [[AltId]] that the system deems most relevant.

      Returns Id<Record> | AltId<Record>


      const displayDiv = `<div class="object-card" id="${baseObject.topId()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • The type name.

      Returns string

      TODO
      
    • Returns the [[Unit]]

      Returns Unit

    • Unlocks the current entry given the version of the current entry. Results in a boolean value indicating if the unlock was a success.

      Parameters

      • version: string

      Returns boolean

      TODO
      
    • Makes changes to the database for this object

      Returns void

    • Returns the [[User]] represented by this [[BaseRecord]]. Will throw an Error if the [[BaseRecord]] does not represent a [[User]].

      Returns User

      TODO
      
    • The version of this object or empty string if it doesn't exist.

      Returns string

      const version = baseObject.version();
      
    • 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.

      Returns string

      const viewBtn = `<button data-href="${baseObject.viewUrl()}">Go to ${baseObject.displayName()}</button>;