Field.isMandatory

Property Description

Returns true if the standard or custom field is required on the record form, or false otherwise.

Type

boolean

Module

N/record Module

Sibling Object Members

Field Object Members

Since

2015.2

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/record Module Script Samples.

          // Add additional code
...
var objRecord = record.load({
    type: record.Type.SALES_ORDER,
    id: 275 
});

var objSublist = objRecord.getSublist({
    sublistId: 'item' 
});

var objField = objSublist.getField({
    fieldId: 'item' 
}); 

if(objField.isMandatory){
    var options = {
        title:'Incomplete Field:',
        message: 'Please complete this field.'
    };
    dialog.alert(options);
...
// Add additional code 

        

Related Topics

General Notices