Hi,
There is a form called CaseCategorySetup, that shows the hierarchy of cases.
Let's say I have this:
Level1 -- that's category type
Level2
let's say I have a form control where it's value is 1A
I have another control, where I want to amend the lookup to get the following result, which is anything under 1A
so the lookup should return to me 11A,111A and 12A -- how can I do that?
i did the following but it's only returning 11A and 12A, how can I get 111A and anything else that might be below 1A?
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(CaseCategoryHierarchyDetail), _formStringControl);
sysTableLookup.addLookupfield(fieldNum(CaseCategoryHierarchyDetail, CaseCategory));
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = query.addDataSource(tableNum(CaseCategoryHierarchyDetail));
CaseCategoryHierarchyDetail caseCategoryHierarchyDetail;
CaseCategoryType caseCategoryType;
select firstonly RecId from caseCategoryHierarchyDetail where caseCategoryHierarchyDetail.CaseCategory == Control1.text()
&& caseCategoryHierarchyDetail.CategoryType == str2Enum(caseCategoryType,CategoryType.text());
//here control1 value is 1A and CategoryType value is Level1
queryBuildDataSource.addRange(fieldNum(CaseCategoryHierarchyDetail,ParentRecId)).value(queryValue(caseCategoryHierarchyDetail.RecId));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();