Bluestep JS Documentation
    Preparing search index...

    Interface MultiFormRecord<T>

    This represents a Multi Entry Form that belongs to a Record.

    const entry = myMultiEntryForm[0];
    
    interface MultiFormRecord<T extends FormEntry> {
        add(e: T): boolean;
        add(index: number, e: T): boolean;
        addAll(c: Collection<T>): boolean;
        addAll(index: number, c: Collection<T>): boolean;
        addSearch(formulaID: string, operator: string, value: any): this;
        addSort(formulaID: string, sortDirection?: SortDirection): this;
        altIdObjects(): { [name: string]: AltId<MultiFormRecord<T>> };
        altIds(): { [name: string]: string };
        altIdsArray(): EList<MultiFormRecord<T>>;
        ancestor<B extends BaseObject<B>>(classType: string | number): B;
        anchorTimestampSearch(arg: number): number;
        asArray(): EList<BaseObject<any>>;
        byId(
            id:
                | string
                | FormEntry
                | Bluestep.Relate.Entry
                | Id<Bluestep.Relate.Entry>
                | Id<FormEntry>,
        ): T;
        children(classType?: string | number): EList<BaseObject<any>>;
        clear(): void;
        clearSearchAndSort(): boolean;
        contains(o: any): boolean;
        containsAll(c: Collection<any>): boolean;
        created(): Instant;
        creator(): User;
        current(): T;
        deletedChildren(): EList<BaseObject<any>>;
        deleteUrl(): string;
        displayName(): string;
        displayName(name: string): void;
        each(action: (e: T, index?: number, elist?: EList<T>) => void): void;
        editUrl(): string;
        forEach(action: Consumer<T>): void;
        forEach(
            callbackfn: (value: T, index: number, array: T[]) => void,
            thisArg?: any,
        ): void;
        form(): Form;
        formRecord(): FormRecord;
        get(index: number): T;
        getAncestors(): EList<BaseObject<any>>;
        hashCode(): number;
        id(): Id<MultiFormRecord<T>>;
        indexOf(o: any): number;
        indexOf(searchElement: T, fromIndex?: number): number;
        isEmpty(): boolean;
        isLocked(): boolean;
        isPendingLock(): boolean;
        isPendingUnLock(): boolean;
        isWritable(): boolean;
        iterator(): Iterator<T>;
        listIterator(): ListIterator<T>;
        listIterator(index: number): ListIterator<T>;
        listProfileUrl(): string;
        listUrl(): string;
        localCache(): LocalCache;
        lock(): Lock;
        meetsCriteria(
            id:
                | string
                | FormEntry
                | Bluestep.Relate.Entry
                | Id<Bluestep.Relate.Entry>
                | Id<FormEntry>,
        ): boolean;
        meetsCriteriaResults(
            id:
                | string
                | Record
                | FormEntry
                | Bluestep.Relate.Entry
                | Id<Bluestep.Relate.Entry>
                | Id<FormEntry>
                | Id<Record>,
        ): { message: string; success: boolean };
        mergeTag(options?: string): string;
        modified(): Instant;
        modifier(): User;
        newEntries(): EList<T>;
        newEntry(copyFrom?: FormEntry): T;
        newEntryUrl(): string;
        optAncestor(classType: string | number): Optional<BaseObject<any>>;
        optById(
            id:
                | string
                | FormEntry
                | Bluestep.Relate.Entry
                | Id<Bluestep.Relate.Entry>
                | Id<FormEntry>,
        ): Optional<T>;
        optCurrent(): Optional<T>;
        optLock(): Optional<Lock>;
        optParent(classType?: string | number): Optional<BaseObject<any>>;
        parent<B extends BaseObject<B>>(classType?: string | number): B;
        rememberSearchAndSort(): boolean;
        remove(index: null): boolean;
        remove(o: any): boolean;
        removeAll(c: Collection<any>): boolean;
        removeIf(filter: Predicate<T>): boolean;
        replaceAll(operator: UnaryOperator<T>): void;
        reset(): void;
        retainAll(c: Collection<any>): boolean;
        set(index: number, element: T): T;
        setMaxRows(newValue: number): boolean;
        size(): number;
        subList(fromIndex: number, toIndex: number): List<T>;
        toArray(): any[];
        toArray<T>(a: T[]): T[];
        topId(): AltId<MultiFormRecord<T>> | Id<MultiFormRecord<T>>;
        typeName(): string;
        update(): void;
        variableName(): string;
        version(): string;
        versions(): EList<BaseObject<MultiFormRecord<T>>>;
        viewUrl(): string;
        [n: number]: T;
    }

    Type Parameters

    Hierarchy (View Summary)

    Indexable

    • [n: number]: T
    Index

    Methods

    • Parameters

      Returns boolean

    • Parameters

      • index: number
      • e: T

      Returns boolean

    • Parameters

      Returns boolean

    • Parameters

      Returns boolean

    • Adds a runtime search to the current set of entries.

      Parameters

      • formulaID: string
      • operator: string
      • value: any

      Returns this

    • Adds a runtime sort to the current set of entries. Use [[B.db.SortDirection]] to specify the sort direction.

      Parameters

      • formulaID: string
      • OptionalsortDirection: SortDirection

        Default is [[SortDirection.FIELD_DEFAULT]].

      Returns this

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

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

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

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

    • For multi-entry reports with search criteria based on the current date/time, causes the report to run as though the current date/time was timestamp. This can be used to view the results of the report as they would have looked in the past or as they will look in the future, assuming today's data. The result of this function is the prior value set, if any.

      Parameters

      • arg: number

      Returns number

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

    • Clears any search criteria, sorts and timestamp anchor which may have been previously set. Also, resets the remember feature. The result of this function is true if search or sort parameters were actually cleared by the function. The result is false if the function did not have any settings to clear.

      Returns boolean

    • Parameters

      • o: any

      Returns boolean

    • Parameters

      Returns boolean

    • 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.`);
      
    • Same as calling optCurrent().orElse(null)

      Returns T

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

      This object doesn't have a deleteUrl. So it returns an empty string.

    • 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

    • Same as Javascripts forEach method.

      Parameters

      • action: (e: T, index?: number, elist?: EList<T>) => void

      Returns void

    • Returns string

      This object doesn't have a editUrl. So it returns an empty string.

    • Parameters

      Returns void

    • Performs the specified action for each element in an array.

      Parameters

      • callbackfn: (value: T, index: number, array: T[]) => void

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns void

    • Returns Form

    • Returns FormRecord

    • Parameters

      • index: number

      Returns T

    • Returns number

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

      Returns Id<MultiFormRecord<T>>


      const displayDiv = `<div class="object-card" id="${baseObject.id()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • Parameters

      • o: any

      Returns number

    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      Parameters

      • searchElement: T

        The value to locate in the array.

      • OptionalfromIndex: number

        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

      Returns number

    • Returns boolean

    • 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();
      
    • Returns if the entry is writable.

      Returns boolean

      let isWritable = curEntry.isWritable()
      ;
    • Returns Iterator<T>

    • Returns ListIterator<T>

    • Parameters

      • index: number

      Returns ListIterator<T>

    • A String field containing the URL to view list the entries of a multi-entry form within the User Profile/My Account area. The URL contained by this field only works correctly when clicked by the user who's record the current entry belongs to. Other users will receive an error when attempting to go to the URL.

      Returns string

    • A String field containing the URL to view list the entries of a multi-entry form. This value will be null for single-entry forms. 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

    • Checks if passed in object has compatible categories and units for the [{MultiFormRecord]]. If you call this methd and it returns false, then byId(val) or optById(val) will thrown an exception. Same as calling meetsCriteriaResults(param).success

      Parameters

      Returns boolean

      TODO
      
    • Checks if passed in object has compatible categories and units for the [{Query]]. Returns a results object. If results.success is false the results.message will contain a message of why.

      Parameters

      Returns { message: string; success: boolean }

      TODO
      
    • TODO

      Parameters

      • Optionaloptions: string

      Returns string

      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();
      
    • Returns a list of new entries that have been created during this formula run.

      Returns EList<T>

    • Creates a new entry of this form that can be used. This can only be used on Multi-Entry forms.

      Parameters

      • OptionalcopyFrom: FormEntry

        New copy of this entry

      Returns T


      const newFormEntry = thisRecord.forms.data.newEntry();
    • A String field containing the URL to create a new entry of this form. This value will be null for single-entry forms. 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

    • 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 same entry the currentEntry import would use in the specific use case where this form was imported under the current record and is also set as the primary form. In all other cases, this will return empty.

      Returns Optional<T>

    • 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

    • For formulas that are part of a merge report, calling this function causes any current, or future, search and/or sort critieria to be remembered and used when displaying the same multi-entry report in the merge report. This also works for the '[all entries]' report. This function should only be called from a merge report formula. Calling it from other types of formulas will have unpredictable results possibly including storing bad data in Relate. This function results in a boolean value which indicates whether calling the function had an effect.

      Returns boolean

    • Parameters

      • index: null

      Returns boolean

    • Parameters

      • o: any

      Returns boolean

    • Parameters

      Returns boolean

    • Parameters

      Returns boolean

    • Parameters

      Returns void

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

      Returns void

    • Parameters

      Returns boolean

    • Parameters

      • index: number
      • element: T

      Returns T

    • Set how many entries you want to return, based on the configured Multi Entry Form Report and runtime searches.

      Parameters

      • newValue: number

      Returns boolean

    • Returns number

    • Parameters

      • fromIndex: number
      • toIndex: number

      Returns List<T>

    • Returns any[]

    • Type Parameters

      • T

      Parameters

      • a: T[]

      Returns T[]

    • 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

    • Returns string

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

      Returns string

      const version = baseObject.version();
      
    • Returns string

      This object doesn't have a viewUrl. So it returns an empty string.