on 06-10-2009 10:36 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.