AxdBase.findList Method [AX 2012]

Finds posted transactions from the database, and then writes them to an XML string.

Syntax

public AifDocumentXml findList(
    AifQueryCriteria _queryCriteria, 
    AifSchemaInfo _xsdInfo, 
    AifEndpointActionPolicyInfo _actionPolicyInfo, 
    AifConstraintListCollection _constraintListCollection, 
    AifPropertyBag _aifPropertyBag)

Run On

Server

Parameters

Return Value

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

Remarks

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

Examples

The following example shows how to find purchase requisitions in Microsoft Dynamics AX by using a query and have them returned as an XML string.

// Example on findList by using a query. 
    AxdBase axdBase =  AxdBase::newClassId( 
        classnum(AxdPurchaseRequisition)); 
    AifQueryCriteria queryCriteria = AifQueryCriteria::construct(); 
    Query                       query; 
    QueryBuildDataSource        queryBuildDataSource; 
    QueryBuildRange             queryBuildRange; 
    AifDocumentXml              xml; 
    AifSchemaInfo               xsdInfo; 
    AifPropertyBag              propertyBag; 
    AifEndpointActionPolicyInfo actionPolicyInfo = new  
        AifEndpointActionPolicyInfo(); 
    AifConstraintListCollection constraintListCollection = new  
        AifConstraintListCollection(); 
  
    query = new Query(); 
    queryBuildDataSource = query.addDataSource( 
        tableNum(vendPurchOrderJour), 
        'vendPurchOrderJour'); 
    queryBuildRange = queryBuildDataSource.addRange( 
        fieldNum(vendPurchOrderJour, purchId)); 
    queryBuildRange.value('..00014_049'); 
    queryCriteria.parmQuery(query); 
  
    propertyBag = [XMLDocPurpose::Proforma]; 
  
    xml = axdBase.findList( 
        queryCriteria,  
        xsdInfo,  
        actionPolicyInfo,  
        constraintListCollection,  
        propertyBag);

The following example shows how to find purchase requisitions in Microsoft Dynamics AX by using an array of criteria and have them returned as an XML string.

// Example on findList using an array of criteria. 
    AxdBase axdBase = AxdBase::newClassId( 
        classnum(AxdPurchaseRequisition)); 
    AifQueryCriteria queryCriteria = AifQueryCriteria::construct(); 
    AifCriteriaElement criteriaElement; 
    AifDocumentXml     xml; 
    AifSchemaInfo      xsdInfo; 
    AifPropertyBag     propertyBag; 
    AifEndpointActionPolicyInfo actionPolicyInfo = new  
         AifEndpointActionPolicyInfo(); 
    AifConstraintListCollection constraintListCollection = new  
         AifConstraintListCollection(); 
  
    criteriaElement = AifCriteriaElement::newCriteriaElement( 
        'vendPurchOrderJour',  
        'purchId',  
        AifCriteriaOperator::LessOrEqual, '00014_049'); 
        queryCriteria.addCriteriaElement(criteriaElement); 
  
    propertyBag = [XMLDocPurpose::Proforma]; 
    xml = axdBase.findList( 
        queryCriteria,  
        xsdInfo,  
        actionPolicyInfo,  
        constraintListCollection,  
        propertyBag);

See Also

AxdBase Class

AifQueryCriteria Class

AifSchemaInfo Class

AifEndpointActionPolicyInfo Class

AifConstraintListCollection Class

AifPropertyBag Extended Data Type

AifDocumentXml Extended Data Type

AxdPurchaseRequisition Class

Query Class

AifCriteriaElement Class