Event.Form.RecordID

Event.Form.RecordID returns the ID of the current record in the form. If this is a new record, then the Event.Form.RecordID will be 0.

Applies To

Properties and Methods

None

Available

The .RecordID property is available in:

  • 15.03.016
  • All newer builds

Note: The .RecordID property and all sub-classes, properties, and methods are only available in Form Layout scripts.

Type

Int32

Syntax

Event.Form.RecordID;

Parameters

None

Example

//--Add this script to an add/edit form's record load event.

var lcRec = 'This is a new record';

//--A number can be treated as a Boolean. Zero is false, all other numbers are true.

if(Event.Form.RecordID)

{

lcRec = 'This record already exists: ' + Event.Form.RecordID;

}

Event.Form.MessageBox(lcRec);

 

/* Expected Prompt response:

This record already exists: 28

*/