getAGFilterSQLText method: IndexFilter Class
Syntax
getAGFilterSQLText(&searchdefn, &records)Description
Use the getAGFilterSQLText method to return SQL condition text for Activity Guide Search Definition indexing. This method is part of the IndexFilter class in the PTSF_AG application package. To set Activity Guide SQL filtering conditions, extend PTSF_AG:IndexFilter in a custom application class and override this method to return SQL condition text for each supported Tools Activity Guide record passed in the &records array.
Parameters
| Parameter | Description |
|---|---|
|
&searchdefn |
Specifies the Activity Guide Search Definition name. |
|
&records |
Specifies the supported Tools Activity Guide record names configured on the Search Definition Advanced tab. The Search Framework passes these record names to the method, and the implementation must return SQL condition text for each record in the same order. |
Returns
Returns an array of strings containing SQL condition text.
Example
import PTSF_AG:IndexFilter;
class AGSqlFilter extends PTSF_AG:IndexFilter
method getAGFilterSQLText(&searchdefn As string, &records As array of string) Returns array of string;
end-class;
method getAGFilterSQLText
/+ &searchdefn as String, +/
/+ &records as Array of String +/
/+ Returns Array of String +/
/+ Extends/implements PTSF_AG:IndexFilter.getAGFilterSQLText +/
Local array of string &sqltext = CreateArrayRept("", 0);
Local string &sql;
&sql = "PTAI_ACTIVE_FLG = 'Y' " | "AND PTAI_REQD = 'Y' " | "AND EXISTS ( " | " SELECT 1 " | " FROM PS_PTAI_LIST L, PS_PTAI_ITEM M " | " WHERE L.PTAI_LIST_ID = M.PTAI_LIST_ID " | " AND L.LASTUPDOPRID IN ( " | " SELECT ROLEUSER " | " FROM PSROLEUSER " | " WHERE ROLENAME LIKE '%PeopleSoft%' " | " ) " | ")";
Local number &i;
For &i = 1 To &records.Len
If &records [&i] = "PTAI_ITEM" Then
Local string &text = "PTAI_REQD='Y'";
&sqltext.Push(&text);
Else
If &records [&i] = "PTAI_LIST" Then
&sqltext.Push(&sql);
Else
&sqltext.Push("PTAI_ITEM_ID <> ''");
End-If;
End-If;
End-For;
Return &sqltext;
end-method;