Bluestep JS Documentation
    Preparing search index...

    Represents one of the available options in an Option List, which is used in [[SingleSelectField]] and [[MultiSelectField]] to provide a limited, pre-defined dataset for a [[User]] to input data.

    Option Lists are created in Relate by going to Admin > Option Lists > New Component > Option List.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • A boolean indicating whether the [[status]] of the [[OptionItem]] is active.

      Behavior:

      • selected/not selected: visible, selectable, and unselectable

      Returns boolean

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

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

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

      // 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);
      
    • 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.`);
      
    • A string value containing the CSS class or classes of the option item.

      Returns string

      TODO
      
    • Temporarily modified the CSS class. If set to a new value then the class given will be visible for the current field and current form entry during the remainder of the current request. If set to an empty string then the original class is restored.

      This value can be changed regardless of the writability of the underlying form entry as it does not actually change any data, just temporarily displays it differently.

      Parameters

      • val: string

      Returns void

      TODO
      
    • An optional string value containing the CSS style of the option item.

      Returns string

      TODO
      
    • Temporarily modify the CSS style. If set to a new value then the style given will be visible for the current field and current form entry during the remainder of the current request. If set to empty string then the original style is restored.

      This value can be changed regardless of the writability of the underlying form entry as it does not actually change any data, just temporarily displays it differently.

      Parameters

      • val: string

      Returns void

      TODO
      
    • 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();
      
    • 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>;
      
    • A boolean indicating whether the [[status]] of the [[OptionItem]] is disabled.

      Behavior:

      • selected: visible (gray), selectable, unselectable
      • not selected: visible (gray), not selectable, unselectable

      Returns boolean

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

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

      Returns string

      const editBtn = `<button data-href="${baseObject.editUrl()}">Go to ${baseObject}</button>`;
      
    • A string value containing the exportValue of this option item. If an option has an export, this value will display when exporting a query or report.

      Returns string

      TODO
      
    • Gets an array of all the object's ancestors.

      Returns EList<BaseObject<any>>

      const numberOfAncestors = obj.getAncestors().length;
      
    • An array of strings containing the list of groups that contain the [[OptionItem]]. The groups are listed beginning with the top level group at index 0 and proceeding to inner groups.

      Returns EList<string>

      TODO
      
    • The [[Id]] of this object bounded to T.

      Returns Id<OptionItem>


      const displayDiv = `<div class="object-card" id="${baseObject.id()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • A number containing the index of this option item.This index is 0 based, so it will always be one less than the display order shown when editing the field.

      Returns number

      TODO
      
    • Returns whether the object is locked or not.

      Returns boolean

      Part of the [[Lock]] API.

      const isLocked = baseObject.isLocked();
      
    • 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();
      
    • A boolean indicating whether this item is currently selected.

      Returns boolean

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

      Returns LocalCache

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

      Returns Lock

    • A boolean indicating whether the [[status]] of the [[OptionItem]] is locked.

      Behavior:

      • selected/not selected: visible (gray), not selectable, not unselectable

      Returns boolean

      TODO
      
    • 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();
      
    • A boolean indicating whether the [[status]] of the [[OptionItem]] is obsolete.

      Behavior:

      • selected: visible, selectable, unselectable
      • not selected: not visible, not selectable, not unselectable

      Returns boolean

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

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

      Returns void

    • This field can be assigned a new value which will cause the [[SingleSelectField]] or [[MultiSelectField]] value to be changed as well. This value can be changed if the underlying form entry is writable in the current formula context.

      Parameters

      • selected: boolean

      Returns void

      TODO
      
    • A number containing the sort order of the [[OptionItem]], beginning with 1.

      Returns number

      TODO
      
    • A string value indicating the status of the option item.

      Returns string

      TODO
      
    • Temporarily modifiy the status. If set to a new value then the option will be shown, hidden or disabled for the current field and current form entry during the remainder of the current request. This value can be changed regardless of the writability of the underlying form entry as it does not actually change any data, just temporarily displays it differently.

      Acceptable inputs (case insensitive):

      • "a" or "active"
      • "o" or "obsolete"
      • "d" or "disabled"
      • "l" or "locked"
      • "": restores the original statusWill return "" for active, and "Obsolete", "Disabled", or "Locked" otherwise.

      Note: An option which [[isSelected]] and [[obsolete]] will behave as though it is [[active]]. An option which [[isSelected]] and [[disabled]] will be gray, but may still be selected or unselected like a normal, [[active]] option. An option which [[isSelected]] and [[locked]] will be gray, and may not be selected or unselected.

      Parameters

      • value: string

      Returns void

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

      Returns Id<OptionItem> | AltId<OptionItem>


      const displayDiv = `<div class="object-card" id="${baseObject.topId()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • If an acutal option item, returns the HTML string a la

      <span style="property: value;" class="op-item-1">Op Item Label</span>```

      Returns string

    • Returns the bluestep.js classpath for the current object.

      Returns string

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

      Returns void

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