TODO

Example

TODO

Hierarchy

  • Util

Constructors

Properties

CssClasses: typeof CssClasses

The [[CssClasses]].

Optional: typeof Optional

TODO

UUID: UUID

Returns a UUID/GUID object. These are system generated universally unique identifiers.

canonicalServerName: string

B.util.canonicalServerName will tell you the fully qualified name of server this script is currently executing on.

currentServer: string

B.util.currentServer will tell you what server this script is currently executing on.

hostAndNamespace: string

B.util.hostAndNamespace will tell you the host.namespace of server this script is currently executing on.

namespace: string

B.util.namespace will tell you the fully qualified name of server this script is currently executing on.

staticPath: string

Returns the static prefix to access static content. Using this prefix will allow the content to be served cached by the browser. This is equivalent \/static/${B.util.version}`` right now. However this may change in the future to a CDN.

version: string

Returns Bluesteps running version

Methods

  • Manually removes a key from the cache. This is useful when you need a query removed from the cache before a commit.

    Type Parameters

    Parameters

    Returns void

  • Convenience method. It just calls B.util.cacheRemove(B.util.toId(id)).

    Parameters

    • id: string

    Returns void

  • A restricted function that clears this organizations data from the cache. Use carefully, as clearing the Cache will cause immediate slowdowns to an organization.

    Returns void

    Example

    B.clearCache();
    
  • Used for updating the running formula.

    Parameters

    • fnc: (() => void)
        • (): void
        • Returns void

    Returns void

  • Create an [[Alert]]. For details see [[AlertBuilder]]. The fields: type, message, and endDate are required.

    Parameters

    • Optional settings: AlertSettings

      Settings object contain field necessary to create the Alert. If parameter is not specified a builder is returned.

    Returns Alert | AlertBuilder

    Example

    Create an alert using a settings object.

    const alert = B.createAlert({
    type: 'auto',
    message: 'Hello World',
    endDate: B.time.Instant.now()
    });

    Example

    Create an alert using a builder.

    const alert = B.createAlert()
    .type('signature')
    .message('Hello World')
    .endDate(B.time.Instant.now())
    .create();
  • Disables the saving of Change History

    Parameters

    • fnc: (() => void)
        • (): void
        • Returns void

    Returns void

    Example

    B.disableChangeHistory(() => {
    //Do updates here and change history will not be saved.
    });
  • Creates an [[Email]] object to send an email.

    Parameters

    Returns Email

    Example

    B.email({
    to: 'user@email.host',
    subject: 'test',
    text: 'Hello World'
    }).send();

    Example

    B.email()
    .to('user@email.host')
    .subject('test')
    .text('Hello World')
    .send();
  • Returns a java HashMap<U, T>

    Type Parameters

    • U

    • T

    Returns Map<U, T>

  • Returns a java HashSet

    Type Parameters

    • T

    Returns Set<T>

  • Returns true if the current users is debugging the current formula.

    Returns boolean

  • Test whether a string is an [[Id]] string

    Parameters

    • id: string

      The string to test

    Returns boolean

    Example

    const isId = B.isId('test'); // false
    
  • Tests the given string and determines if it is valid JSON.

    Parameters

    • potentialJsonString: string

    Returns boolean

    Example

    const isValid = B.util.isValidJson("{\"some\":\"thing\"}");
    
  • Turns a javascript Object into a Java.Map<String, T>

    Type Parameters

    • T

    Parameters

    • Optional map: {
          [key: string]: T;
      }
      • [key: string]: T

    Returns Map<String, T>

  • Converts a Map<string, T> to an object.

    Type Parameters

    • T

    Parameters

    • map: Map<String, T>

    Returns {
        [key: string]: T;
    }

    • [key: string]: T
  • Creates a new java BigDecimal object from the given value.

    Parameters

    • value: string | number

    Returns BigDecimal

    Example

    const bigDecimal = B.util.newBigDecimal("123.45");
    
  • Creates a new java BigInteger object from the given value.

    Parameters

    • value: string | number

    Returns BigInteger

    Example

    const bigInteger = B.util.newBigInteger("123456789012345678901234567890");
    
  • Returns a new Calendar object with the current time.

    Parameters

    Returns Calendar

  • Returns a Java Properties Object

    Parameters

    • Optional map: {
          [key: string]: any;
      } | Map<any, any>

    Returns Map<any, any>

  • Provides you the id of the currently running Script

    Returns string

  • Super User Only.

    Returns any

  • Creates an [[Shlink]] object to generate a short link.

    Parameters

    Returns Shlink

  • Delays the continued execution of this thread for the specified number of milliseconds. While this method certainly has its uses, it is generally not recommended for use in most scripts; since it is easy to be tempted to use it to "bandaid" design flaws.

    Parameters

    • duration: number

    Returns void

    Example

    console.log("I'm executed now");
    B.delay(10000);
    console.log("I'm executed ten seconds later");
  • Creates an [[TextMessage]] object to send an Text.

    Parameters

    Returns TextMessage

    Example

    const ptoDate = pto.fields.date.val();
    const mPhone = contactInfo.fields.phone.val();
    B.util.text({
    message: 'Your PTO ${ptoDate} was approved',
    to: mPhone,
    unit: pto.formRecord().record().unit().id().longId(),
    id: contactInfo.id().toString()
    }).send();
  • Convert the name and value and the class type to an [[AltId]]

    Type Parameters

    Parameters

    • name: string

      The AltId's name.

    • value: string

      The AltId's value.

    • classType: string | number

      Value representing the class type of AltId

    Returns AltId<B>

    Example

    const altid = B.toAltId('animal', 'dog', 222222);
    

    Example

    const altid = B.toAltId('animal', 'dog', 'myassn.user.User');
    
  • If a short id is passed it uses the classIfIdIsShortId to identify its class. Otherwise what ever class stored in the id is used.

    Type Parameters

    Parameters

    • IdOrSortId: string

      Value representing an full or short id.

    • classIfIdIsShortId: string | number

    Returns Id<B>

    Example

    const id = B.toAnyId('5', 222222);
    

    Example

    const id = B.toAnyId('5', 'myassn.user.User');
    
  • Does it best to change the value to a Host Object. A conversion will be tried for Objects and Arrays. If it or a member can't be converted then toString() will be used for the value.

    Returns any

  • Convert a full or short id and its class type to an [[Id]]

    Type Parameters

    Parameters

    • id: string

      Value representing an full or short id.

    • Optional classType: string | number

      Required when id represents a short id.

    Returns Id<B>

    Example

    const id = B.toId('222222___5');
    

    Example

    const id = B.toId('5', 222222);
    

    Example

    const id = B.toId('5', 'myassn.user.User');
    
  • Convert a full or short id and its class type to an Id object, or null if it doesn't exist.

    Type Parameters

    Parameters

    • id: string

      string representing a full id.

    Returns Id<B>

    Example

    const id = B.toIdOrNull('222222___5');
    
  • Returns a UUID/GUID string. This is the same as calling B.util.UUID.randomUUID().toString();

    Returns string

Generated using TypeDoc