AxdBase.initMandatoryFieldsMap Method [AX 2012]

Creates a list of mandatory fields that are specific to the document. The document must override this method to add mandatory fields that are not mandatory in the data model.

Syntax

protected void initMandatoryFieldsMap()

Run On

Server

Remarks

The initMandatoryFieldsMap is called by the framework to set up the mandatory fields defined on this document. The document class should override this method to specify mandatory fields on the document class or mandatory fields that are not mandatory on Ax<table> classes by the document. The mandatory fields for a document are the fields that are mandatory for each Ax<table> class plus the fields that are added in this method. For a description of how the mandatory fields for an Ax<table> class are determined, see the AxInternalBase Class.

All fields on the document class, the Ax<table> classes, and table fields can be specified as mandatory. To specify a field as mandatory, use the AxdBase.setParmMethodAsMandatory Method or the AxdBase.setTableFieldAsMandatory Method.

Examples

The following example shows how to specify a mandatory field on the document, Ax<table> class, and table.

protected void initMandatoryFieldsMap() 
{ 
    super();   
    this.setParmMethodAsMandatory( 
        classnum(AxdSalesOrder), 
        methodstr(AxdBase,parmDocPurpose)); 
    this.setParmMethodAsMandatory( 
        classnum(AxSalesLine), 
      methodstr(AxSalesLine,parmSalesQty)); 
    this.setTableFieldAsMandatory( 
        tablenum(SalesLine), 
        fieldstr(SalesLine,SalesUnit)); 
}

See Also

Reference

AxdBase Class