Share via


AxdBase.readList Method [AX 2012]

Reads posted transactions from the database and writes them to an XML string.

Syntax

public AifDocumentXml readList(
    AifEntityKeyList _entityKeyList, 
    AifSchemaInfo _xsdInfo, 
    AifEndpointActionPolicyInfo _actionPolicyInfo, 
    AifConstraintListCollection _constraintListCollection, 
    AifPropertyBag _aifPropertyBag)

Run On

Server

Parameters

  • _entityKeyList
    Type: AifEntityKeyList Class
    A list of entity keys that identify the transactions to be read.

Return Value

Type: AifDocumentXml Extended Data Type
An XML string that contains the data of the transaction.

Remarks

The readList method is implemented on the AxdBase Class. If a document does not provide the corresponding action type (SendDocumentList), the readList method. It must be overridden on the document class for this method to throw an error if called. For example, AxdSalesPackingSlip.readList.

Examples

The following example shows how to read all purchase requisitions in Microsoft Dynamics AX into an XML string.

    AxdBase                     axdBase = 
  AxdBase::newClassId(classnum(AxdPurchaseRequisition)); 
    AifEntityKey                aifEntityKey; 
    AifEntityKeyList            aifEntityKeyList =  
  AifEntityKeyList::construct(); 
    Map                         keyData; 
    VendPurchOrderJour          vendPurchOrderJour; 
    AifDocumentXml              xml; 
    AifSchemaInfo               xsdInfo; 
    AifEndpointActionPolicyInfo actionPolicyInfo = new  
  AifEndpointActionPolicyInfo(); 
    AifConstraintListCollection constraintListCollection = new   
  AifConstraintListCollection(); 
    AifPropertyBag              propertyBag; 
 
    while select vendPurchOrderJour 
    { 
        // Create Key Data. 
        keyData = SysDictTable::getKeyData(vendPurchOrderJour); 
 
        // Create Entity Key. 
        aifEntityKey = AifEntityKey::construct(); 
        aifEntityKey.parmKeyDataMap(keyData); 
 
        aifEntityKeyList.addEntityKey(aifEntityKey); 
    } 
 
    propertyBag = [XMLDocPurpose::Proforma]; 
    xml = axdBase.readList(aifEntityKeyList, xsdInfo, actionPolicyInfo,  
  constraintListCollection, propertyBag);

See Also

AxdBase Class

AifEntityKeyList Class

AifSchemaInfo Class

AifEndpointActionPolicyInfo Class

AifConstraintListCollection Class

AifPropertyBag Extended Data Type

AifDocumentXml Extended Data Type

AxdPurchaseRequisition Class