Resolve Reference For Reference Group Look uploo

Hi All

In Our Project ,We have Reference group Look up .In this Lookup ,We have to Remove the Duplicate(repeated) values through Resolve Reference method.

I am New to Ax 2012

Please Help Regarding this .For example Lookup Come like this

A

B

B

A

C

D

A

B

But I want Like

A

B

C

D

I Tried sysReferenceTableLookup,parmUseLookupValue(False ),But this is not working

Thanks in Advanced

Welcome to DUG!!!

Moving your question to AX forum for faster response.

Hi,

Use Group by option before sysReferenceTableLookup.parmQuery(query);

QueryBuilddatasource qbds;

qbds.orderMode(OrderMode::GroupBy);

qbds.addSortField(fieldnum(TestTable, YourField1));

Hope this will resolve your problem.

//Abbas

Thanks Abbas.But This Look Up Is for Reference Group,So What ever Idea you gave is not working for me .please explain more

public Common lookupReference(FormReferenceControl _formReferenceControl)

{

Common ret;

SysReferenceTableLookup sysReferenceTableLookup;

QueryBuildDataSource qbdsPositionDetails,qbdsJobDetails,qbdsJob;

HcmJob _HcmJob;

Query query = new Query();

sysReferenceTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmJob),_formReferenceControl, true);

// sysReferenceTableLookup.parmUseLookupValue(false);

qbdsJob = query.addDataSource(tableNum(HcmJob));

qbdsPositionDetails = qbdsJob.addDataSource(tableNum(HcmPositionDetail));

qbdsPositionDetails.relations(true);

qbdsPositionDetails.addRange(fieldNum(HcmPositionDetail,Department)).value(queryValue(HCMResRequirement.Department));

// qbdsPositionDetails.orderMode(OrderMode::GroupBy);

//qbdsPositionDetails.addSortField(fieldNum(HcmJob,JobId));

sysReferenceTableLookup.addLookupField(fieldNum(HcmJob,JobId));

sysReferenceTableLookup.addLookupMethod(‘description’);

sysReferenceTableLookup.parmQuery(query);

_HcmJob = sysReferenceTableLookup.performFormLookup();

return _HcmJob;

}

Thanks Amol.