on 06-10-2009 11:02 AM
first define a resultdefine:
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);
then i use RetrieveLimitedRecordsCommand,i can get the record and i can use
record.getLookupDisplayValue(fieldsMT[2])
get the field's display value;but when i use RetrieveMatchedRecordsCommand i can not use
record.getLookupDisplayValue(fieldsMT[2]) to get the display value again, i want to know if when i excute a matching strategy and get the matched record is same with normal query.
Simple Answer
RetrieveMatchedRecordsCommand is to get the matching result of a record and needs a Matching Id.
RetrieveLimitedRecordsCommand is to get a set of records which match your search criterion.
the reason why RetrieveMatchedRecordsCommand is not returning anything or giving an error is because you are not passing a matching Id. This command comes into use when you are using a matching strategy defined in MDM.
If your query is just to retrieve some records that match ur search criteria, use RetrieveLimitedRecordsCommand.
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,
For running matching you are using "ExecuteMatchingStrategyForNewRecordValuesCommand" command which do not actually creates a record in MDM. 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 |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.