Designed to hold a serializable object for BluestepJS formulas.

Type Parameters

Hierarchy

Constructors

Methods

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

    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);
    
  • 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());
    
  • Clear the field's value.

    Returns void

    Example

    // This is a surprisingly non-trivial example.numberField.val() > 10 && numberField.clear();// There are many things going on here:
    // 1) We are performing a check that a value even exists in this field. If not, nothing happens.
    // 2) If the first condition is met, we then check that the value is a number or a string representing a number
    // (remember: '5'==5 in JavaScript), and that it is greater than 10. If not, nothing happens.
    // 3) If the first two conditions are met, the field is then cleared of its value.
  • 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.`);
    
  • 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

  • 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>`;
    
  • Returns this field's [[FormMetaData]] object.

    Returns FormMetaData

    Example

    const form = firstName.form();
    const fieldNames = [];
    for (field in form) fieldNames.push(form[field].displayName());
  • The [[Id]] of this object bounded to T.

    Returns Id<R>

    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 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 whether the field is writable

    Returns boolean

    Example

    const firstNameClass = firstName.isWritable() ? 'active' : 'inactive';
    
  • Parameters

    • Optional options: string

    Returns string

  • 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();
    
  • Optional value for this field. Same as [[valOpt]]. Try to use this as often as you can over val(); Null-pointer exceptions can be a pain, and this will provide a measure of safety. Try to reserve val() for situations where a field is required and you know that the value cannot be null.

    Returns Optional<Serializable>

    Example

    const middleName = middleName.opt().orElse('No Middle Name Set!');
    // or, similarly
    const middleName = middleName.val() || 'No Middle Name Set!'
    explore example
    [[Java.Optional.isPresent]]
  • 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

  • Get the field's value, or else it will return null. This is the same as calling opt().orElse(null) without typescript complaining. In many cases, this is also the same as simply calling val(), however some field implementations wish to employ defaults, such as text fields that return an empty string if they are null.

    Returns Serializable

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

    Returns void

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

    Returns AltId<R> | Id<R>

    Example


    const displayDiv = `<div class="object-card" id="${baseObject.topId()}">
    <div class="title">${baseObject}</div>
    <div class="body">Hello World!</div>
    </div>;
  • Returns the bluestep.js classpath for the current object.

    Returns string

    Example

    const isBool = testForm.fields.mysteryField.typeName().toLowerCase().includes('boolean')
    
  • Makes changes to the database for this object

    Returns void

  • Sets the field's value using a serializable object.

    Parameters

    Returns void

    Example

    TODO
    
  • Set the field's value.

    Returns Serializable

    Example

    // make the field say `hello`
    field.val('hello');
  • Optional value for this field. Alias for [[opt]].

    Returns Optional<Serializable>

    Example

    date.valOpt().map(val => `Report Date: ${val}`).orElse('No Date');
    
    explore example
    [[Java.Optional.map]], [[Java.Optional.orElse]]
  • 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