Bluestep JS Documentation
    Preparing search index...

    Class FormMetaData

    TODO

    TODO
    

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Fields

    mefReports: MefrMetaDatas

    Multi Entry Form Reports

    Methods

    • Adds the key-value pair to the AltIds of this object. This will overwrite any existing value for the key on any object that has the same classId without warning you, so use this with caution.

      Parameters

      • key: string
      • value: string

      Returns void

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

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

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

      // 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.`);
      
    • 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>;
      
    • Returns the label of the Form. Outside of Relate, the displayName will be overridden if a [[label]] is present.

      Returns string

      const formLabel = entry.formMetaObj().displayName();
      
    • Returns an edit URL for this object, else a blank string.

      Returns string

      const editBtn = `<button data-href="${baseObject.editUrl()}">Go to ${baseObject}</button>`;
      
    • Get the [[Form]] associated with the [[FormMetaData]].

      Returns Form

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


      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();
      
    • Returns whether the entry is part of a Single Entry Form.

      Returns boolean

      if (form.isSingleEntry()) throw new Error('You cannot create additional entries on a single-entry form');
      
    • Returns the label of the Form. The label overrides the [[displayName]] anywhere outside of Relate.

      Returns string

      const formLabel = entry.formMetaObj().label();
      
    • Returns the Local Cache object for this Thread/Base Object.

      Returns LocalCache

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

      Returns Lock

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

    • Removes the AltId with the specified key from this object, if it has one. There is no error if the key does not exist.

      Parameters

      • key: string

      Returns void

    • Calling require off a form adds it as a member of the form. It can then be accessed using standard JavaScript dot or bracket notation as whatever name you give it.

      When require is called in imports.js, it creates a branch of the dependency tree for that object. It's not required to call require inside of imports.js, but if you don't, that object won't show up in the inspector.

      Parameters

      • Optionalparams: string | RequireParams

        If a string, that is used as the formula reference. If empty, defaults to the object's FID (see [[AltId]]).

      Returns FormMetaData

      Use object destructing to get specific fields from a form

      const formsByFID = B.queries.byFID['allIndividuals'].require().forms.byName;
      formsByFID['name'].require();
      const {firstName, lastName} = formsByName.name.fields.byFormulaId;
    • Reset the current object so that it is cleared from the cache and looked up from the database.

      Returns void

    • All Summary [[Field]] Objects regardless of if they contain a formula id.

      Returns [Field<any, any>]

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

      Returns AltId<FormMetaData> | Id<FormMetaData>


      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

      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>;
      
    • Sets the form to writable. If this is not called, you will only be able to perform R from CRUD. It's suggested to do this in imports.js before calling [[require]]. Returns itself.

      Returns FormMetaData

      B.queries.byFID['allPeople'].require()
      .forms.byFID['name'].writable().require();
      explore example
      [[B.queries]], [[BaseObjectLookup.byFID]], [[QueryMetaData.require]], [[QueryMetaData.forms]], [[require]]