AxInternalBase.validateInboundCurrencyString Method [AX 2012]

Validates the string length for an incoming currency code string.

Syntax

protected void validateInboundCurrencyString(str _string, DictField _dictField)

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 the string relates to.

Remarks

The validateInboundCurrencyString method is used in parm<FieldName> methods where the field relates to currency code.

The validateInboundCurrencyString 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 maximum length for the passed parameter.

The validateInboundCurrencyString method uses the XMLMapCurrency code that is defined in the AxInternalBase.mapPolicy Method to define the maximum length of the incoming string.

Examples

The following example shows how the validateInboundCurrencyString method is implemented in the AxSalesTable.parmCurrencyCode method.

public str parmCurrencyCode(str _currencyCode = '') 
{ 
    DictField   dictField; 
    if (!prmisdefault(_currencyCode)) 
    { 
        dictField = new DictField(Tablenum(SalesTable), 
                         fieldnum(SalesTable, CurrencyCode)); 
        this.validateInboundCurrencyString(_currencyCode, dictField); 
 
        if(this.valueMappingInbound()) 
        { 
            _currencyCode = this.axCurrencyCode(_currencyCode); 
        } 
 
        this.setField(fieldnum(SalesTable, CurrencyCode), 
                              _currencyCode); 
    } 
    if (this.valueMappingOutbound()) 
    { 
        return this.axCurrencyCode(salesTable.CurrencyCode); 
    } 
    else 
    { 
        return salesTable.CurrencyCode; 
    } 
}

See Also

Reference

AxInternalBase Class