This object contains meta data related to the currently opened form; such as the state of the form, the user that is currently signed in, the the form record and much more.

To access this information via JavaScript, use the global JavaScript object window.XFC_METADATA. When you open a form, this object is added automatically and filled with the relevant information.

Hierarchy

  • XfcMetadata

Index

Properties

attachments

attachments: MetadataAttachment[]

A list of all attachments of the current form record.

This includes only files that were uploaded with an upload element in the form. It does not include files uploaded in the inbox. This list is empty when the form was not submitted or saved yet. You can access this property when the form is opened in the inbox to check the attachments.

currentClient

currentClient: MetadataClient

The client to which the current form belongs to.

currentLanguage

currentLanguage: string

Short name of the current language, eg. default, en, orde`.

currentLanguageTag

currentLanguageTag: string

The current language and variant, eg. default, en-US, or de-DE.

currentProcess

currentProcess: MetadataProcess

The current form record. An empty object when no form records exists, ie. when the form was not submitted yet.

currentProject

currentProject: MetadataProject

Data related to the current form, such as its ID or its name.

currentSessionFRID

currentSessionFRID: string

The current form request session ID, eg. 88b4069a-b489-454d-9c1c-350ab4a2e83d. This session ID is created when the user opens a form and it is valid until the user submits (or saves) the form. A user may have multiple form session IDs when they open a form multiple times in different tabs. This is a security feature and also prevents a form from being submitted more than once, such as when the user presses the submit button twice.

currentSessionID

currentSessionID: string

The current J2EE application container session ID (JSESSIONID), eg. 5151BE9E69A42FE78D98580E24B3F23B. When a user opens multiple tabs with a form, the session ID will be the same - for an ID unique to each form, see currentSessionFRID.

currentUser

currentUser: MetadataCurrentUser

The currently signed in user. In case the user is not signed in, the user data refers to an anonymous user. For example, the first name (currentUser.surename) is set to [Anonymous].

deprecated

This property is deprecated, you should use XFC_METADATA.user instead. Please note that some properties of that object are different, e.g. XFC_METADATA.currentUser.surename is now XFC_METADATA.user.firstName.

pluginResults

pluginResults: object

The results of a pre-render plugin. A pre-render plugin is executed before the form is rendered and may add data to the form, such as the result of contacting a web service. This object contains the plugin results with one key for each plugin name.

Type declaration

  • [pluginName: string]: any

renderStatus

renderStatus: string

The state that was used to render the form. Please note that this state may be different from the state of the form record associated (if any) with the current form. For example, when you open a preview of the form in the designer, you can choose to preview the form in different states. Depending on which state you choose, the value of this property will be different. However, as it is a preview, there is no asscociated form record, so XFC_METADATA.currentProcess.status will be empty.

requestType

requestType: FormRequestType

Possible request types for forms that indicate how the form was opened. Some of these options are only for internal use and should not be used.

  • provide: When the form was opened for the first time and not submitted yet. No form records exists yet for the form.
  • preview: Preview of a form, ie. when you open the form in the preview mode of the designer.
  • print: When the form was opened by the server to generate a printed document, such as a PDF document or an image.
  • process: Processing a form. This is set when the form is submitted.
  • review: When the form is opened in the inbox. A form record now exists for the form.

serverTime

serverTime: Date

The current time of the server. Use this instead of new Date() to retrieve the current time without having to rely on the client's browser or OS.

urlParams

urlParams: object

An object of all URL parameters in the URL of the current page.

Type declaration

  • [urlParamKey: string]: string

urls

An object with all FORMCYCLE-specific resources, such as database queries or plugin servlets. You should always use these URLs instead of hard-coding URLs. This way you can make sure that your code keeps working even when the URL to the FORMCYCLE system changes.

user

The currently signed in user. In case the user is not signed in, the user data refers to an anonymous user. For example, the first name (currentUser.firstName) is set to [Anonymous].