FORMULA LANGUAGE


Accessing the current document in the formula language
Example

For form actions, buttons, hotspots, and field formulas, the current document is the one that's open. For view actions, the current document is the one that's highlighted (not checked). For agents, the current document is the one being acted on according to the build selection and SELECT reserved word criteria.

To read from a field in the current document, name the field or use the @GetField function, which returns the value of the field whose name you specify. When you specify a field name, case does not matter, but the name must exactly match the field name. This function returns null if the value of the specified field is null or the specified field does not exist.

To write to a field in the current document, you must use the FIELD reserved word or the @SetField function. You cannot simply name the field.


The DEFAULT reserved word provides a value in the event that a field is not in the document. If the field is available, its value is used. If the field is unavailable, the DEFAULT value is used.
The @MailSend function mails a document. @MailSend without parameters mails the current document, which must contain a field named SendTo containing the recipients. @MailSend with parameters constructs the document to be mailed from the parameters.
The @DeleteField function deletes a field. You specify it as the expression in a FIELD assignment.
The @DocMark([NoUpdate]) function prevents formula changes to the document from being written to storage. The document is the same after processing by the formula as before. This @function only affects agents.

This table lists @functions that return document and field attributes.
FunctionDescription
@AllChildrenSelects immediate responses to matched documents; use only in a selection formula.
@AllDescendantsSelects all responses to matched documents; use only in a selection formula.
@AttachmentLengthsReturns the size in bytes of each attachment.
@AttachmentModifiedTimesReturns the date on which the file attached to the current document was last modified.
@AttachmentNamesReturns the file names of all attached files.
@AttachmentsReturns the number of attached files.
@AuthorReturns the abbreviated names of all authors.
@DocFieldsReturns the names of all the fields in the document.
@DocLengthReturns the size in bytes of the document.
@DocumentUniqueIDReturns the document's unique ID, which is unique across all replicas of the document; in a field, creates a doclink to the current document.
@GetFocusTableReturns the name, current row, or current column of the table that is in focus.
@InheritedDocumentUniqueIDReturns the unique ID of the parent document; in a field, creates a doclink to the current document.
@IsAvailable(field)Returns True (1) if a field exists in the document.
@IsDocBeingEditedReturns True (1) if the document is in Edit mode.
@IsDocBeingLoadedReturns True (1) if the document is being loaded.
@IsDocBeingMailedReturns True (1) if the document is being mailed.
@IsDocBeingRecalculatedReturns True (1) if the document is being recalculated.
@IsDocBeingSavedReturns True (1) if the document is being saved.
@IsNewDocReturns True (1) if the document is not yet saved.
@IsResponseDocReturns True (1) if the document is a response.
@IsUnavailable(field)Returns True (1) if a field does not exist in the document.
@NoteIDReturns "NT" followed by the note ID of the document.
@PolicyIsFieldLockedReturns True (1) if the field is locked by an administration policy.
@ResponsesReturns the number of responses to the current document in the current view.

Example
See Also