Highlighted
Mark-sai Respected Contributor.
Respected Contributor.
343 views

RM.net SDK search by record type does not work in CM9 anymore

I am using below code to search for container by passing in Title and Record Type. It is working fine in RM8.3. But it does not run when I used it in CM9.3.

Another piece of code without passing in Record Type still working fine. 

 

TrimMainObjectSearch objSearch = new TrimMainObjectSearch(rmDB, BaseObjectTypes.Record);
TrimSearchClause titleClause = new TrimSearchClause(rmDB, BaseObjectTypes.Record, SearchClauseIds.RecordTitle);
titleClause.SetCriteriaFromString(title);
TrimSearchClause objFilter = new TrimSearchClause(rmDB, BaseObjectTypes.Record, SearchClauseIds.RecordType);
objFilter.SetCriteriaFromString(recordType);

objSearch.AddFilterClause(objFilter);
objSearch.AddSearchClause(titleClause);
objSearch.And();

foreach (Record objRec in objSearch)
{

container = objRec.LongNumber;

}

Tags (1)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: RM.net SDK search by record type does not work in CM9 anymore

It worked for me but only when I removed the And.  The and is not necessary as you are only adding one search clause, given that you are using filter for Record Type.


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
Mark-sai Respected Contributor.
Respected Contributor.

Re: RM.net SDK search by record type does not work in CM9 anymore

For me when I replace with the below code it works. The original code works fine in RM8.3 though. 

TrimMainObjectSearch objSearch = new TrimMainObjectSearch(rmDB, BaseObjectTypes.Record);
objSearch.SetSearchString("title:" + title);
objSearch.SetFilterString("recordtype:" + recordType);

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.