A Relate Record. Category and [[Unit]] changes are not stored instantly to the database. They are stored after the current formula(s) completes (formulas may run in small batches during complex edits). The category and unit changes will be stored before other types of saves are completed and before other batches of formulas run.

Type Parameters

Hierarchy

Constructors

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

    Example

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

    Returns {
        [name: string]: AltId<T>;
    }

    Example

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

    • [name: string]: string

    Example

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

    Example

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

    Example

    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>

    Example

    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;
    }

    • [key: string]: boolean

    Example

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

    Parameters

    • Optional classType: string | number

    Returns EList<BaseObject<any>>

    Example

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

    Returns Instant

    Example

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

    Returns User

    Example

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

    Example

    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

    Example

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

    Example

    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.

    Returns string

    Example

    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

    Returns Folder

    Example

    TODO
    
  • Document Library URL.

    Returns string

    Example

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

    Returns string

    Example

    const editBtn = `<button data-href="${baseObject.editUrl()}">Go to ${baseObject}</button>`;
    
  • The [[Id]] of this object bounded to T.

    Returns Id<T>

    Example


    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

    Deprecated

    Part of the [[Lock]] API.

    Example

    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

    Deprecated

    Part of the [[Lock]] API.

    Example

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

    Returns boolean

    Deprecated

    Part of the [[Lock]] API.

    Example

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

    Returns boolean

  • The modified date of this object.

    Returns Instant

    Example

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

    Returns User

    Example

    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

    • Optional flags: string

    Returns RecordNavItem

    Example

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

    Parameters

    • classType: string | number

    Returns Optional<BaseObject<any>>

    Example

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

    Returns Optional<Lock>

    Deprecated

    Part of the [[Lock]] API.

    Example

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

    Parameters

    • Optional classType: string | number

    Returns Optional<BaseObject<any>>

    Example

    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

    • Optional classType: string | number

    Returns B

  • Pending record categories with changes.

    Returns EList<BaseObject<any>>

    Example

    TODO
    
  • 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

    Example

    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

    Example

    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

    Example

    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

    Example

    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

    Example

    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

    Example

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

    Returns AltId<T> | Id<T>

    Example


    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

    Example

    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

    Example

    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

    Example

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

    Returns string

    Example

    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

    Example

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

Generated using TypeDoc