AxdBase.findEntityKeyList Method [AX 2012]
Finds entity keys that identify posted transactions in the database.
Syntax
public AifEntityKeyList findEntityKeyList(AifQueryCriteria _queryCriteria, AifEndpointActionPolicyInfo _actionPolicyInfo)
Run On
Server
Parameters
- _queryCriteria
Type: AifQueryCriteria Class
An instance of the AifQueryCriteria Class that contains either a query or an array of criteria to identify the documents from.
- _actionPolicyInfo
Type: AifEndpointActionPolicyInfo Class
An instance of the AifEndpointActionPolicyInfo Class to specify the value mapping to perform. This class can be empty if no value mapping is to occur.
Return Value
Type: AifEntityKeyList Class
A list that contains the entity keys that define the documents that are identified by the query or the array of criteria.
Remarks
The findEntityKeyList method is implemented on the AxdBase Class. If a document does not provide the corresponding action type (QueryEntityKeys), the findEntityKeyList method must be overridden on the document class for the findEntityKeyList method to throw an error if called. For example, the AxdSalesPackingSlip.findEntityKeyList method.
Examples
The following example shows how to find entity keys on purchase requisitions in Microsoft Dynamics AX by using a query.
// Example on findEntityKeyList using a query. AxdBase axdBase = AxdBase::newClassId(classnum(AxdPurchaseRequisition)); AifQueryCriteria queryCriteria = AifQueryCriteria::construct(); Query query; QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; AifEndpointActionPolicyInfo actionPolicyInfo = new AifEndpointActionPolicyInfo(); AifEntityKeyList entityKeyList; query = new Query(); queryBuildDataSource = query.addDataSource(tableNum(vendPurchOrderJour), 'vendPurchOrderJour'); queryBuildRange = queryBuildDataSource.addRange(fieldNum(vendPurchOrderJour, purchId)); queryBuildRange.value('..00014_049'); queryCriteria.parmQuery(query); entityKeyList = axdBase.findEntityKeyList(queryCriteria, actionPolicyInfo);
The following example shows how to find entity keys on purchase requisitions in Microsoft Dynamics AX by using an array of criteria.
// Example on findEntityKeyList by using an array of criteria. AxdBase axdBase = AxdBase::newClassId(classnum(AxdPurchaseRequisition)); AifQueryCriteria queryCriteria = AifQueryCriteria::construct(); AifCriteriaElement criteriaElement; AifEndpointActionPolicyInfo actionPolicyInfo = new AifEndpointActionPolicyInfo(); AifEntityKeyList entityKeyList; criteriaElement = AifCriteriaElement::newCriteriaElement('vendPurchOrderJour', 'purchId', AifCriteriaOperator::LessOrEqual, '00014_049'); queryCriteria.addCriteriaElement(criteriaElement); entityKeyList = axdBase.findEntityKeyList(queryCriteria, actionPolicyInfo);