Bluestep JS Documentation
    Preparing search index...

    Class FieldMetaData<T>

    The litany of metadata associated with a field.

    Most of the metadata examples use the following accessor as a base:

    explore example
    [[B.queries]], [[BaseObjectLookup.byFID]], [[B.QueryMetaData.require]], [[B.FormMetaData.fields]]

    But don't think that there are no other ways to get to a field.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Returns the activeX value of a field.

      Returns string

      const val = fields.firstName.metaData().activeX();
      
    • Returns the advanced options value of a field.

      Returns string

      const val = fields.firstName.metaData().advancedOpts();
      
    • Returns the allow other of the field.

      Returns string

      const allowOther = fields.firstName.metaData().allowOther();
      
    • An object of alternate ids for this object, with values as [[AltId]]

      Returns { [name: string]: AltId<FieldMetaData<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<FieldMetaData<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

    • 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);
      
    • Returns the autocopy value of a field.

      Returns string

      const val = fields.firstName.metaData().autocopy();
      
    • Returns the checkbox label of a boolean field. Only applicable when [[formatType]] is checkbox.

      Returns string

      const checkboxLabel = fields.clear.metaData().booleanCheckboxLabel();
      // 'Clear date range'
    • Returns the radio false label of a boolean field. Only applicable when [[formatType]] is radio.

      Returns string

      const falseLabel = fields.pendApproval.metaData().booleanRadioFalseLabel();
      // 'Remove Record'
    • Returns the radio true label of a boolean field. Only applicable when [[formatType]] is radio.

      Returns string

      const trueLabel = fields.pendApproval.metaData().booleanRadioTrueLabel();
      // 'Accept Record'
    • Returns the cardinality value of a field.

      Returns string

      const val = fields.firstName.metaData().cardinality();
      
    • 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 the cleanup value of a field.

      Returns string

      const val = fields.firstName.metaData().cleanup();
      
    • 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.`);
      
    • Returns the custom lock value of a field.

      Returns string

      const val = fields.firstName.metaData().customLock();
      
    • Returns the custom params of the field.

      Returns string

      const customParams = fields.firstName.metaData().customParams();
      
    • Returns the data length of the field.

      Returns string

      const dataLength = fields.firstName.metaData().dataLength();
      
    • Returns fields data type.

      Returns FieldDataType

    • Returns the default value of the field.

      Returns string

      const defaultValue = fields.firstName.metaData().defaultValue();
      
    • Returns the default value type of the field.

      Returns string

      const defaultValueType = fields.firstName.metaData().defaultValueType();
      
    • 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 display cut off value of a field.

      Returns string

      const val = fields.firstName.metaData().displayCutOff();
      
    • Returns the display cut off 2 value of a field.

      Returns string

      const val = fields.firstName.metaData().displayCutOff2();
      
    • 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>`;
      
    • Returns the entity type of a field.

      Returns string

      const val = fields.firstName.metaData().entityType()
      ;
    • Get the [[Field]] associated with the [[FieldMetaData]]. It will search for a current [[Record]] and throw an error if it can't find one.Current [[Record]] is not available on End Points.

      Parameters

      • Optionalwritable: boolean

        Defaults to false.

      Returns Field<any, T>

      TODO
      
    • Get the [[Field]] associated with the [[FieldMetaData]], given a particular [[BaseRecord]].

      Parameters

      • record: BaseRecord<any>

        A [[BaseRecord]] that the [[Field]]'s [[Form]] is attached to.

      • Optionalwritable: boolean

        Defaults to false.

      Returns Field<any, T>

      TODO
      
    • Returns the field control field key of a field. The possible values are a list of the [[BooleanField]]s, [[SingleSelectField]]s, and [[SignatureField]]s. Only accessible when [[fieldControlType]]is custom.

      Returns string

      const customViewKey = fields.date.metaData().fieldControlFieldKey(); // 'signature'
      
    • Returns the field control field value of a field. The possible values are a list of the possible values of the selected [[fieldControlFieldKey]]. Only accessible when [[fieldControlType]] is custom.

      Returns string

      const customViewVal = fields.date.metaData().fieldControlFieldValue(); // 'signed'
      
    • Returns the field control type of a field.

      • Normal (''): Editing and viewing of the field based strictly on permissions
      • Hidden (hiddenDefault): Always hidden on the generic layout
      • View-Only (readonlyDefault): Always view-only on the generic layout
      • Calculated (smartHide): Generic layout displays view-only when the field has a value or hidden when it is empty
      • Once (readonlyWhenCompleted): The field displays as normal until it is completed, then it becomes view-only
      • Custom (custom): See [[fieldControlView]]

      Returns string

      // check that a date field is view-only when the form has been signed
      const controlType = fields.date.metaData().fieldControlType(); // 'custom'
      const customView = fields.date.metaData().fieldControlView(); // 'readonly'
      const customViewKey = fields.date.metaData().fieldControlFieldKey(); // 'signature'
      const customViewVal = fields.date.metaData().fieldControlFieldValue(); // 'signed'
    • Returns the field control view of a field. Only accessible when [[fieldControlType]] is custom.

      • View-Only (readonly): Becomes view-only when conditions are met
      • Hidden (hidden): Becomes hidden when conditions are met

      Returns string

      const customView = fields.date.metaData().fieldControlView(); // 'readonly'
      
    • Returns the format type of the field.

      • Text: none, memo, phone, email, measurement, url, state, taxId, zip, selection, medName, medProductID, ICD9Dx, ICD10CM, ICD10Next, DSM5, medBillingRevCode, drugAllergy, drugAllergyRxNorm, bp, cptCode, labCodes, creditCard, medispanBehaviors
      • Memo: none, emailList, html
      • Date/Time: date, time, dateTime
      • Number: integer, float, money
      • Boolean: checkbox, radio
      • Single Select: select, list, lookup, radio
      • Multiple Select: list, lookup, checkboxGroup
      • signature: simple, secure
      • Document: name, thumbnail
      • Relationship: See [[displayCutOff]]
      • Biometric: signaturepad, biometric
      • Merge Report: full, small

      Returns string

      const formatType = fields.email.metaData().formatType(); // 'email'
      
    • The [[FormMetaData]] object associated with this field.

      Returns FormMetaData

    • Returns the field formula, which is used to modify the field on save. Both itself and other fields can be referenced here via [[formulaId]].

      Returns string

      const fieldFormula = fields.firstName.metaData().formula();
      // 'lastName + ", " + firstName'
    • Returns the formula id of a field, which is used to reference the field in a [[formula]].

      Returns string

      const formulaIds = Object.values(fields).map(f => f.metaData().formulaId());
      // ['firstName', 'prefName', 'email', ...]
    • Gets an array of all the object's ancestors.

      Returns EList<BaseObject<any>>

      const numberOfAncestors = obj.getAncestors().length;
      
    • Returns the grouping value of a field.

      Returns string

      const val = fields.firstName.metaData().grouping();
      
    • Returns the height of the field.

      Returns string

      const height = fields.firstName.metaData().height();
      
    • Returns the hint of the field. The hint can be displayed either below the label or in a popup. See [[popUpHint]].

      Returns string

      const hint = fields.midName.metaData().hint();
      // 'The middle name is the one between the first and last names'
    • The [[Id]] of this object bounded to T.

      Returns Id<FieldMetaData<T>>


      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 the label of the field. A label overrides the display name in display situations.

      Returns string

      const label = fields.aka.metaData().label(); // 'Alias/Nickname'
      
    • Returns the list options key of the field.

      Returns string

      const listOpKey = fields.firstName.metaData().listOptionsKey();
      
    • Returns the Local Cache object for this Thread/Base Object.

      Returns LocalCache

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

      Returns Lock

    • Returns whether long label format has been checked or not.

      Returns string

      const longLabel = fields.firstName.metaData().longLabel(); // 'false'
      
    • Returns the maximum value of the field. Applies to number fields.

      Returns string

      const maxValue = fields.firstName.metaData().maximumValue();
      
    • Returns the max number of characters that can be input into the field.

      Returns string

      const maxLength = fields.firstName.metaData().maxLength(); // 'null'
      
    • Returns the minimum value of the field. Applies to number fields.

      Returns string

      const minValue = fields.firstName.metaData().minimumValue();
      
    • 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 the never hide hint of the field.

      • true: Never hide the hint\n- false: Hide the hint when the field is view-only

      Returns string

      const neverHideHint = fields.firstName.metaData().neverHideHint(); // 'false'
      
    • Returns the new column of a field.

      Returns string

      const val = fields.firstName.metaData().newColumn();
      
    • 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

    • Returns the picker option of the field.

      Returns string

      const pickerOption = fields.firstName.metaData().pickerOption();
      
    • Returns the placeholder of the field.

      Returns string

    • Returns whether popup hint has been checked or not. When unchecked, the hint is always viewable beneath the field label.

      Returns string

      const popupHint = fields.firstName.metaData().popUpHint(); // 'false'
      
    • Returns the postfix of the field.

      Returns string

      const postfix = fields.firstName.metaData().postfix();
      
    • Returns the prefix of the field.

      Returns string

      const prefix = fields.firstName.metaData().prefix();
      
    • Returns the print format type of the field.

      Returns string

      const printFormatType = fields.firstName.metaData().printFormatType();
      
    • Returns the reciprocal of a field.

      Returns string

      const val = fields.firstName.metaData().reciprocal();
      
    • Returns the relationship of a field.

      Returns string

      const val = fields.firstName.metaData().relationship();
      
    • Returns the relationship to of the field.

      Returns string

      const relWith = fields.firstName.metaData().relationshipTo();
      
    • Returns the relationship with of the field.

      Returns string

      const relWith = fields.firstName.metaData().relationshipWith();
      
    • Returns the report label of the field. The report label supercedes label and display name in report views.

      Returns string

      const reportLabel = fields.firstName.metaData().reportLabel();
      // 'The name by which you shall henceforth be known is'
    • Add the field so the inspector can find it.

      Parameters

      • writable: boolean

        When true, mark in the inspector that the field is writable

      Returns FieldMetaData<T>

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

      Returns void

    • Returns the show link value of a field.

      Returns string

      const val = fields.firstName.metaData().showLink();
      
    • Returns the static content value of a Static Content Data Type.

      Returns string

      const val = fields.staticDiagram.metaData().staticContent();
      
    • Returns the style class of a field.

      Returns string

      const styleClass = fields.email.metaData().styleClass(); // 'email'
      
    • Returns the sub format type of the field.

      Returns string

      const subFormatType = fields.firstName.metaData().subFormatType();
      
    • Returns the symmetric value of a field.

      Returns string

      const val = fields.firstName.metaData().symmetric();
      
    • The [[Id]] or [[AltId]] that the system deems most relevant.

      Returns AltId<FieldMetaData<T>> | Id<FieldMetaData<T>>


      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>;
      
    • Returns the width of the field. If the [[formatType]] is 'text' or 'password', most browsers interpret <input> width as ems (the width of the letter 'M'). It should be interpreted as pixels otherwise.

      Returns string

      const width = fields.firstName.metaData().width(); // '20'