******************Get Request Start****************** with( local!request: if(isnull(ri!requestType),"",ri!requestType), local!status: if(isnull(ri!status),"",ri!status), /* local!pagingInfo: if( isnull(ri!pagingInfo), a!pagingInfo( startIndex: 1, batchSize: 20 ), ri!pagingInfo ), */ local!datasubset: a!queryEntity( entity: cons!MY_CDT, query: a!query( selection: a!querySelection(columns: { a!queryColumn(field: "requestType"), a!queryColumn(field: "status"), }), logicalExpression: a!queryLogicalExpression( operator: "AND", filters:{ a!queryFilter( field: "requestType", operator: if(local!request="All Requests","in","="), value: if(local!request="All Requests",{"New","Old","Current"},local!request) ), if(local!status="",{}, a!queryFilter( field: "status", operator: "=", value: local!status )), } ), /* As you want to get only 20 records at time make paging info as input to the query entity and the always the refreshed pagingInfo can get the required set of data*/ pagingInfo: ri!pagingInfo ) ), if(local!datasubset.totalCount=0,"No Results",local!datasubset) ) **********Get Request End***************** *********Display results start************ =load( local!pagingInfo:a!pagingInfo( startIndex: 1, batchSize:20, sort: a!sortInfo(field: "requestID", descending: true)), local!requestType:"All Requests", local!status:"New", with( local!datasubset:rule!GetRequest( requestType: local!requestType, status:local!status, pagingInfo: local!pagingInfo ), a!formLayout( firstColumnContents:{ a!sectionLayout( validations:{if(local!datasubset="No Results","No Results Found", "")}, firstColumnContents:{ a!dropdownField( label:"Request Type: ", choiceLabels: {"All Requests","New","Old","Current"}, choiceValues: {"All Requests","New","Old","Current"}, placeholderLabel: "---Select Request Type---", value: local!requestType, saveInto:{ local!requestType, a!save(local!pagingInfo, a!pagingInfo( startIndex: 1, batchSize:20, sort: a!sortInfo(field: "requestID", descending: true))) } ), } ), if(local!datasubset <>"No Results", a!gridField( label: "results", totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "Status:", field: "status", data: index(local!datasubset.data, "status", {}) ), a!gridTextColumn( label: "Request Type:", field: "requestType", data: index(local!datasubset.data, "requestType", {}) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ),{}) } ) ) ) ****************Display results end*******************