cancel
Showing results for 
Search instead for 
Did you mean: 

when the method getLookupDisplayValue is can be used?????

Former Member
0 Kudos

the following is the code segment:

TableId mainTableId = repository.getTableId("MT_MATS"); //主表

ResultDefinition rd = new ResultDefinition(mainTableId);

FieldId[] fieldsMT = new FieldId[5];

fieldsMT[0] = repository.getFieldId("MT_MATS", "MAT_GLDN_NUM"); //物料编码

fieldsMT[1] = repository.getFieldId("MT_MATS", "MAT_GLDN_DESC_LONG_CN"); //物料全称

fieldsMT[2] = repository.getFieldId("MT_MATS", "MAT_GLDN_5497"); //物料组(5497编码) lookup field

fieldsMT[3] = repository.getFieldId("MT_MATS", "MAT_MIS_TAG"); //信息系统标识 lookup field

fieldsMT[4] = repository.getFieldId("MT_MATS", "MAT_DEL_TAG"); //删除标记

rd.setSelectFields(fieldsMT);

ExecuteMatchingStrategyForNewRecordValuesCommand efvc = new ExecuteMatchingStrategyForNewRecordValuesCommand(repository.connPool);

efvc.setSession(repository.getNewSession());

efvc.setStrategyId(strategyId);;

efvc.setSource(newRds);

efvc.setTarget(searchTarget);

efvc.execute();

RetrieveMatchedRecordsCommand rmrc = new RetrieveMatchedRecordsCommand(repository.connPool);

rmrc.setSession(repository.getNewSession());

rmrc.setResultDefinition(rd);

rmrc.setMatchingTaskId(taskId);

rmrc.setRecordId(new RecordId(RecordId.EMPTY_ID));

rmrc.execute();

Record rdmatching = rmrc.getMatchingResult().getMatchedRecordResults()[j].getMatchedRecord();

then i execute the following code :

rdmatching.getLookupDisplayValue(fieldsMT[2])

but the result is null,i want to know why rdmatching.getLookupDisplayValue(fieldsMT[2]) = null;

who can help me thank you!!!!

Edited by: badboy on Jun 10, 2009 11:36 AM

Edited by: badboy on Jun 10, 2009 11:37 AM

Accepted Solutions (1)

Accepted Solutions (1)

nitin_mahajan2
Contributor
0 Kudos

While executing the matching strategy,

RetrieveMatchedRecordsCommand rmrc = new RetrieveMatchedRecordsCommand(repository.connPool);

rmrc.setSession(repository.getNewSession());

rmrc.setResultDefinition(rd);

rmrc.setMatchingTaskId(taskId);

rmrc.setRecordId(new RecordId(RecordId.EMPTY_ID));

rmrc.execute();

In this execution, use

RetrieveMatchedRecordsCommand.setSupportingResultDefinitions( )

here are the API details

public void setSupportingResultDefinitions(ResultDefinition[] supportingResultDefinitions)

Sets the result definition (optional). The result definition specifies the list of field/columns to retrieve the data for.

The result definitions are the RDs of the lookup tables.

It helps.

Regards,

Nitin

Former Member
0 Kudos

thank you for your help under your help ,i resolved the problem!thank you!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

You are using "ExecuteMatchingStrategyForNewRecordValuesCommand" command and with this command

getDisplayValue returns a null value. I think using "ExecuteMatchingStrategyCommand" inspite of "ExecuteMatchingStrategyForNewRecordValuesCommand" command will solve your problem.