Bluestep JS Documentation
    Preparing search index...

    Class DocumentLinkField

    TODO

    TODO
    

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

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

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

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

      // 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());
      
    • Clears a document field to no longer reference a document. If shouldDelete is true, it will also delete the document it's referencing. If shouldDelete is false, it will leave the document untouched. If shouldDelete is absent, it will follow the document's cleanup policy (defined in field edit).

      Parameters

      • OptionalshouldDelete: boolean

      Returns void

    • Same as calling documentVersions().content(settings). See [[DocumentVersions.content]]

      Parameters

      Returns string

    • Sets the content to the provided bytes after applying [[NewContentSettings]]. Same as newContent().apply(settings).content(bytes)

      Parameters

      Returns void

    • Sets the content to the string after applying [[NewContentSettings]]. Same as newContent().apply(settings).content(content)

      Parameters

      Returns void

    • See [[DocumentVersions.contentFromUrl]]

      Parameters

      • url: string

      Returns void

    • Same as calling documentVersions().contentSize(). See [[DocumentVersions.contentSize]]

      Returns number

    • Same as calling documentVersions().contentTimestamp(). See [[DocumentVersions.contentTimestamp]]

      Returns Instant

    • Same as calling documentVersions().contentType(). See [[DocumentVersions.contentType]]

      Returns string

    • Same as calling documentVersions().contentType(). See [[DocumentVersions.contentType]]

      Parameters

      • contentType: string

      Returns void

    • The "created at" timestamp of this object.

      Returns Instant

      const createdAt = `<div class="created-at">${baseObject.created()}</div>`;
      
    • Same as calling documentVersions().createdCredential(). See [[DocumentVersions.createdCredential]]

      Returns string

    • Same as calling documentVersions().createdTimestamp(). See [[DocumentVersions.createdTimestamp]]

      Returns Instant

    • The creator of this object.

      Returns User

      alert(`Guess who created this. It was ${baseObject.creator().fullName()}. They are to blame.`);
      
    • Same as calling documentVersions().davUrl(). See [[DocumentVersions.davUrl]]

      Returns string

    • TODO

      Parameters

      • OptionalmillisOrLocalDate: number | LocalDate

      Returns string

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

      Returns 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

    • 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 documentVersions().existingContent(). See [[DocumentVersions.existingContent]]

      Returns ExistingContent

    • Same as calling documentVersions().filename(). See [[DocumentVersions.filename]]

      Returns string

    • Same as calling documentVersions().folder(). See [[DocumentVersions.folder]]

      Returns Folder

    • Same as calling documentVersions().forInputStream(settings, input => {}). See [[DocumentVersions.forInputStream]]

      Parameters

      Returns void

    • Returns this field's [[FormMetaData]] object.

      Returns FormMetaData

      const form = firstName.form();
      const fieldNames = [];
      for (field in form) fieldNames.push(form[field].displayName());
    • Sets the content to the provided OutputStream after applying [[NewContentSettings]]. Same as newContent().apply(settings).forOutputStream(out => {})

      Parameters

      Returns void

    • Same as calling documentVersions().forReader(settings,reader => {}). See [[DocumentVersions.forReader]]

      Parameters

      Returns void

    • Sets the content to the provided Writer after applying [[NewContentSettings]]. Same as newContent().apply(settings).forWriter(writer => {})

      Parameters

      Returns void

    • Same as calling documentVersions().fullPath(). See [[DocumentVersions.fullPath]]

      Returns string

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


      const displayDiv = `<div class="object-card" id="${baseObject.id()}">
      <div class="title">${baseObject}</div>
      <div class="body">Hello World!</div>
      </div>;
    • Same as calling documentVersions().imageHeight(). See [[DocumentVersions.imageHeight]]

      Returns number

    • Same as calling documentVersions().imageWidth(). See [[DocumentVersions.imageWidth]]

      Returns number

    • 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();
      
    • Same as calling documentVersions().notes(). See [[DocumentVersions.isVersioned]]

      Returns boolean

    • Returns whether the field is writable

      Returns boolean

      const firstNameClass = firstName.isWritable() ? 'active' : 'inactive';
      
    • TODO

      Returns string

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

      Returns LocalCache

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

      Returns Lock

    • Parameters

      • Optionaloptions: string

      Returns string

    • Returns the [[FieldMetaData]] object that this describes this field.

      Returns FieldMetaData<any>

      const firstNameClass = firstName.metaData().styleClass();
      
      explore example
      [[FieldMetaData.styleClass]]
    • The modified date of this object.

      Returns Instant

      const isModified = baseObject.modified();
      
    • Same as calling documentVersions().modifiedTimestamp(). See [[DocumentVersions.modifiedTimestamp]]

      Returns Instant

    • The [[User]] that last modified this object.

      Returns User

      const modifierName = baseObject.modifier().fullName();
      
    • TODO

      Parameters

      • destPath: string
      • Optionalcreate: boolean

      Returns void

    • Return a [[NewContent]]

      Returns NewContent

    • Same as calling documentVersions().notes(). See [[DocumentVersions.notes]]

      Returns string

    • Same as calling documentVersions().notes(). See [[DocumentVersions.notes]]

      Parameters

      • notes: string

      Returns void

    • Optional value for this field. Same as [[valOpt]]. Try to use this as often as you can over val(); Null-pointer exceptions can be a pain, and this will provide a measure of safety. Try to reserve val() for situations where a field is required and you know that the value cannot be null.

      Returns Optional<any>

      const middleName = middleName.opt().orElse('No Middle Name Set!');
      // or, similarly
      const middleName = middleName.val() || 'No Middle Name Set!'
      explore example
      [[Java.Optional.isPresent]]
    • 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

    • Same as calling documentVersions().path(). See [[DocumentVersions.path]]

      Returns string

    • Same as calling documentVersions().permUrl(). See [[DocumentVersions.permUrl]]

      Returns string

    • Same as calling documentVersions().referenceCount(). See [[DocumentVersions.referenceCount]]

      Returns number

    • Same as calling documentVersions().rename(filename). See [[DocumentVersions.rename]]

      Parameters

      • filename: string

      Returns void

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

      Returns void

    • Same as calling documentVersions().thumbnail(). See [[DocumentVersions.thumbnail]]

      Returns DocumentThumbnail

    • Same as calling documentVersions().thumbnail(thumbnailSettings). See [[DocumentVersions.thumbnail]]

      Parameters

      Returns string

    • 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

    • Gets the field's value if there is one, and will otherwise return null. Some overrides of this method have default return-values for convenience but, that would not make sense for this: the general-use case. In situations where the value might be null (e.g. non required field), consider using optional chaining: field.val()?.toString(). The preferred method to handle nulls in bs.js is simply [[opt]]/[[valOpt]]; as the methods available off of that can handle virtually any situation.

      This is identical to calling field.opt().orElse(null).

      Returns any

      // it is important to notice that, due to how JavaScript works, doubleVal will evaluate to 0 if numberField.val() is null.
      const doubleVal = numberField.val() * 2;
    • Set the field's value.

      Parameters

      • newValue: any

        The value to be put into the field.

      Returns void

      // make the field say `hello`
      field.val('hello');
    • Optional value for this field. Alias for [[opt]].

      Returns Optional<any>

      date.valOpt().map(val => `Report Date: ${val}`).orElse('No Date');
      
      explore example
      [[Java.Optional.map]], [[Java.Optional.orElse]]
    • Returns string

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

      Returns string

      const version = baseObject.version();
      
    • Same as calling documentVersions().versioned(). See [[DocumentVersions.versioned]]

      Parameters

      • versioned: boolean

      Returns void

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