Hi ,
I have list of year in drop down which i want to sort without using paging info function ?
Can we do that ?
Discussion posts and replies are publicly visible
But to use this paging info i have to convert data to dataset which i don't want. I just simply want to apply sorting on year on my local!year data which i am getting from different dataset where already one kind of sorting has been done in expression rule. So before or further i don't want to break any chain.
Further i am using this local!year in below code where i am getting error so like that at different places i have to make changes if i convert this into dataset with paging info
local!data: rule!get_Data( local!id, "address" ).data,
local!years: reject( fn!isNull, union( local!data.year, local!data.year ) ),
Hi Saurav,
There is only one optimised way to achieve this requirement, i.e. by using datasubset(with pagingInfo) which you don't want to go for.
Hence frankly to say there are no such optimised solution for your requirement other than OOTB approach of datasubset with pagingInfo
Here is my suggested answer based on your restriction not to make change in source of data, or any other objects.=========================================create a rule named getYearObject
code....{year:ri!year}
input...year (number integer)=========================================create a parent rule named getYearObjectArray
code...a!foreach(items:ri!years,expression:rule!getYearObject(fv!item))
input...years (number integer) multiple=========================================In your master rule write below code.For understanding I am writing code step by step.
local!yearDummyData:{2011,2012,2002,2014},local!pagingInfo:a!pagingInfo(startIndex:1, batchSize:-1 sort: a!sortInfo(field: "year",ascending: true()))local!yearObjects:rule!getYearObjectArray(years:local!yearDummyData),local!sortedYears:todatasubset(local!yearObjects,local!pagingInfo),local!answer:index(local!sortedYears.data,"year",{})
Hope this works as standalone code.
Regards,Mayur Mondhe