Hi,
I am using the below code to search in MDM table. But i am not getting the records.
Kindly suggest.
repositorySchema = getRepositorySchemaCommand.getRepositorySchema();
TableId tableId= repositorySchema.getTable("Products").getId();
wdComponentAPI.getMessageManager().reportSuccess(""+tableId);
FieldId[] fields = new FieldId[1];
wdComponentAPI.getMessageManager().reportSuccess("test4");
fields[0] = repositorySchema.getFieldId("Products", "Name");
wdComponentAPI.getMessageManager().reportSuccess("test5");
//fields[1] = repositorySchema.getFieldId("Products", "Father's Name");
wdComponentAPI.getMessageManager().reportSuccess("test6");
wdComponentAPI.getMessageManager().reportSuccess(""+fields[0]);
//wdComponentAPI.getMessageManager().reportSuccess(""+fields[1]);
//
//FieldSearchDimension fieldSearchDimension = new FieldSearchDimension(fields[1]);
//TextSearchConstraint textSearchConstraint = new TextSearchConstraint("prasanthi father", TextSearchConstraint.EQUALS);
FieldSearchDimension fieldSearchDimension1 = new FieldSearchDimension(fields[0]);
TextSearchConstraint textSearchConstraint1 = new TextSearchConstraint("sravan",TextSearchConstraint.EQUALS);
//
Search search = new Search(tableId);
//search.addSearchItem(fieldSearchDimension, textSearchConstraint);
search.addSearchItem(fieldSearchDimension1, textSearchConstraint1);
//
ResultDefinition rd = new ResultDefinition(tableId);
rd.setSelectFields(fields);
//
//
RetrieveLimitedRecordsCommand retrieveLimitedRecordsCommand = new RetrieveLimitedRecordsCommand(simpleConnection);
retrieveLimitedRecordsCommand.setSession(authenticateUserSessionCmd.getSession());
retrieveLimitedRecordsCommand.setResultDefinition(rd);
retrieveLimitedRecordsCommand.setSearch(search);
//
retrieveLimitedRecordsCommand.execute();
totalRecord = retrieveLimitedRecordsCommand.getRecords().getCount();
wdComponentAPI.getMessageManager().reportSuccess("records are"+totalRecord);