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.

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

Run On

Server

Parameters

_xml
Type: AifDocumentXml Extended Data Type
An XML string that contains the data (transactions) to persist to the database.
_actionPolicyInfo
Type: AifEndpointActionPolicyInfo Class
An instance of the AifEndpointActionPolicyInfo Class. Use this class to specify the value mapping to perform. This class can be empty if no value mapping is to occur.
_constraintListCollection
Type: AifConstraintListCollection Class
A collection of lists that contains the constraints that are identified for each document.
The _constraintListCollection parameter must be an instantiated, empty AifConstraintListCollection Class. It is populated when the createList method is run.

Return Value

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

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.

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); 
    }

Community Additions

ADD
Show: