Bluestep JS Documentation
    Preparing search index...

    Class Alert

    TODO

    TODO
    

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

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

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

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

      // 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);
      
    • This method does one of two things. If executed before the startDate, it deletes the alert thus leaving no record it was ever sent. If executed after the startDate, it sets the endDate to the current date and time.

      Returns boolean

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

    • This method is simply a shortcut to set the status to 100. Returns true if done successfully

      Returns boolean

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

      Returns string

      const editBtn = `<button data-href="${baseObject.editUrl()}">Go to ${baseObject}</button>`;
      
    • Same as calling optEnd().orElse(null)

      Returns Instant

    • Sets the ending instant for this alert. This is a required setting on this object.

      Parameters

      Returns void

    • Marks an alert as completed; while aborting its trigger. Returns true is successful.

      Returns boolean

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


      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 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();
      
    • TODO

      Returns string

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

      Returns LocalCache

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

      Returns Lock

    • Gives the message that this alert would produce; handy for debuging.

      Returns string

    • Sets the message for this alert to produce.

      Parameters

      • message: string

      Returns void

    • 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 [[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 set ending Instant as an optional.

      Returns Optional<Instant>

    • 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]]
    • Returns the set starting Instant as an optional.

      Returns Optional<Instant>

    • This is a read-only DateTime value (in the form of a Java.Optional) containing the exact time the status field was last changed.Same as calling optStatusTimestamp().orElse(null)

      Returns Optional<Instant>

    • TODO

      Returns Optional<User>

    • Same as calling optParent(var).orElse(null)

      Type Parameters

      Parameters

      • OptionalclassType: string | number

      Returns B

    • This is an Integer value containing the priority of the alert.

      Returns number

    • This is an Integer value containing the priority of the alert. The priority may be set to a new value in the range 1-10 where 1 is the highest priority. If any other value is set, it will be ignored.

      Parameters

      • val: number

      Returns void

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

      Returns void

    • This is the Integer value indicating the snoozeDelay in milliseconds. Each time the user views an alert it is snoozed for the specified time period. This means that it will stop playing any sound and the blinking alert indicator will turn off.

      Returns number

    • Sets the Integer value indicating the snoozeDelay in milliseconds. Each time the user views an alert it is snoozed for the specified time period. This means that it will stop playing any sound and the blinking alert indicator will turn off.

      Parameters

      • val: number

      Returns void

    • This is an Integer field containing the delay in milliseconds between each repeat of playing the sound.

      Returns number

    • This is an Integer field containing the delay in milliseconds between each repeat of playing the sound.

      Parameters

      • val: number

      Returns void

    • Sets the name of the Bluestep Sound for this alert, must be among a select list.

      Parameters

      • soundName: "bark" | "bong" | "chime" | "error" | "info" | "knock" | "phaser" | "vibrate"

      Returns void

    • This is a String value containing the URL of a internet-ready sound file which is played repeatedly to get the attention of the recipient of the alert.

      Returns string

    • This is a String value containing the URL of a internet-ready sound file which is played repeatedly to get the attention of the recipient of the alert.

      Parameters

      • val: string

      Returns void

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

      Returns Instant

    • Sets the starting instant for this alert. If left unset it will default to right now.

      Parameters

      Returns void

    • This is a Integer value containing the current status of the alert. It may be set to any value from 0 to 100.

      Returns number

    • This is a Integer value containing the current status of the alert. It may be set to any value from 0 to 100. Attempts to set the field to any other value will be ignored and the original value will be retained.

      Parameters

      • val: number

      Returns void

    • This is a read-only DateTime value containing the exact time the status field was last changed.Same as calling optStatusTimestamp().orElse(null)

      Returns Instant

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

      Returns User

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

      Returns AltId<Alert> | Id<Alert>


      const displayDiv = `<div class="object-card" id="${baseObject.topId()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • Returns the type of the alert. It may be either "percent", "signature", or "auto"

      Returns string

    • Sets/overrides the existing alert type. This is a read-only String value containing the type of the alert. It is one of three values: "percent", "signature" or "auto". The percent type allows the recipient to set the status of the alert to a percent value between 0 and 100 in increments of 10 percent. The signature type allows the status to be set to 100 by checking a box. The auto type does not allow the recipient to set the status.

      Parameters

      • type: "percent" | "signature" | "auto"

      Returns void

    • 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

    • This is a String value containing an identifying value that can be used to retrieve this alert.

      Returns string

    • This is a String value containing an identifying value that can be used to retrieve this alert. It cannot be the same as any other alert ever sent. If an attempt is made to set this value to one that is already used by another alert, any changes to this alert will fail to save, which may cause the alert to never be sent. Maximum of 200 characters.

      Parameters

      • userId: string

      Returns void

    • TODO

      Returns EList<User>

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