AxInternalBase.validateInboundString Method [AX 2012]

Validates the string length for an incoming string.

Syntax

protected void validateInboundString(
    str _string, 
    DictField _dictField, 
   [XMLMapExternalCode _xmlMapExternalCode])

Run On

Called

Parameters

  • _string
    Type: str
    The string that the length is to be validated for.
  • _dictField
    Type: DictField Class
    The DictField class for the field that the string relates to.

Remarks

The validateInboundString method is used in parm<FieldName> methods that contain code for performing value mapping.

The validateInboundString method is created because parm<FieldName> methods that are using value mapping use "str" as parameter type and therefore do not have an extended data type to define the maximum length for the passed parameter.

Examples

The following example shows how the validateInboundString method is implemented in the AxSalesTable.parmCustAccount method.

public str parmCustAccount(str _custAccount = '') 
{ 
    DictField dictField; 
    ; 
    if (!prmisdefault(_custAccount)) 
    { 
        dictField = new DictField(tablenum(SalesTable), 
                   fieldnum(SalesTable, CustAccount)); 
        if(this.valueMappingInbound()) 
        { 
            this.validateInboundString(_custAccount, dictField, 
                                 this.mapPolicy().xMLMapCustAccount()); 
            _custAccount = this.axCustAccount(_custAccount); 
        } 
        else 
        { 
            this.validateInboundString(_custAccount, dictField); 
        } 
 
        this.setField(fieldnum(SalesTable, CustAccount), _custAccount); 
    } 
    //... 
}

See Also

Reference

AxInternalBase Class