Expand Minimize
This topic has not yet been rated - Rate this topic

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.

protected void initMandatoryFieldsMap()

Run On

Server

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.

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)); 
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.