AxdBase.createList Method [AX 2012]

Creates the documents in the XML string as transactions in the database, and then returns the entity keys of the created transactions.

Syntax

public AifEntityKeyList createList(
    AifDocumentXml _xml, 
    AifEndpointActionPolicyInfo _actionPolicyInfo, 
    AifConstraintListCollection _constraintListCollection)

Run On

Server

Parameters

Return Value

Type: AifEntityKeyList Class
A list that contains the entity keys that define each of the created transactions.

Remarks

The createList method is implemented on the AxdBase Class.

If a document does not provide the corresponding action type (ReceiveDocumentList), the createList method must be overridden on the document class for the createList method to throw an error if called. For example, AxdPurchaseRequisition.createList Method.

Examples

The following example shows how to create sales orders from the ThreeSalesOrders.xml file.

    XMLDocument                 xmlDoc = new XMLDocument(); 
    AifDocumentXml              xml; 
    AxdSalesOrder               SalesOrder; 
    AifEndpointActionPolicyInfo actionPolicyInfo = new 
  AifEndpointActionPolicyInfo(); 
    // Value mapping is not used here, but the 
    // AifEndpointActionPolicyInfo class must be instantiated. 
    AifConstraintListCollection constraintListCollection = new 
  AifConstraintListCollection();  
    // The object will be populated when the AxdBase.createList 
    // method is run. 
    AifEntityKeyList            entityKeyList; 
    FileIOPermission            fileIOPermission = new  
  FileIOPermission('C:\\ThreeSalesOrders.xml', 'r'); 
 
    fileIOPermission.assert(); 
    if (xmlDoc.load('C:\\ThreeSalesOrders.xml')) 
    { 
        xml = xmlDoc.xml(); 
        SalesOrder = AxdBase::newClassId(Classnum(AxdSalesOrder)); 
        entityKeyList = SalesOrder.createList(xml, actionPolicyInfo, 
  constraintListCollection); 
    }

See Also

AxdBase Class

AifDocumentXml Extended Data Type

AifEndpointActionPolicyInfo Class

AifConstraintListCollection Class

AifEntityKeyList Class

AxdSalesOrder Class