AxInternalBase.validateInboundItemIdString Method [AX 2012]

Validates the string length for an incoming string that relates to item Id.

Syntax

protected void validateInboundItemIdString(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 validateInboundItemIdString method is used in parm<FieldName> methods where the field relates to item Id.

The validateInboundItemIdString 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.

The validateInboundItemIdString method uses the XMLMapItemId 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 validateInboundItemIdString method is implemented in the AxSalesLine.parmItemId method.

public str parmItemId(str _itemId = '') 
{ 
    DictField   dictField; 
 
    if (!prmisdefault(_itemId)) 
    { 
        dictField = new DictField(tablenum(SalesLine), 
                                  fieldnum(SalesLine,ItemId)); 
        this.validateInboundItemIdString(_itemId,dictField); 
        if (this.valueMappingInbound()) 
        { 
            item = _itemId; 
        } 
        this.setField(fieldnum(SalesLine, ItemId), _itemId); 
    } 
    if (this.valueMappingOutbound()) 
    { 
        return conpeek(this.axSalesItemId(salesLine.CustAccount, 
                     salesLine.ItemId,salesLine.inventDim()),1); 
    } 
    else 
    { 
        return salesLine.ItemId; 
    } 
}

See Also

Reference

AxInternalBase Class