@IsNewDoc (JavaScript)

Indicates if the current document is a new document.

Defined in

@Functions (JavaScript)

Syntax

@IsNewDoc() : int
Return value Description
int 1 if the document is new; otherwise 0.

Usage

A new document is one that is not saved yet.

Examples

This example is the formula for a label field. The label is either New document or the value of the field1 element.
// Formula for computing label_1
var title = "";
if(@IsNewDoc() == 1) title = "New document";
else title = @GetTextField("//field1");
title;