Smartobject custom method or a filter

  • 28 March 2014
  • 4 replies
  • 2 views

Badge +2

Hi,

 

I need a custom method on a smartobect stored in the smartbox. I essentially need a filter or a sql query. I kind of want the top 5 items sorted on a column. I am not sure how about going to do this? I know there are filters using which i can sort but the top 5 thing is something i am not able to achieve. Do i need to create a stored procedure for this??

Appreciate ur help.

I will be usig this query in a smartform to populate a drop down list.


4 replies

Badge +6

Hi,


 


Depending on which version of SmartForms you are currently using, the filtering functionality is much better on newer releases, it is possible to set a filter on a control. This is done directly on the control itself, in the properties where the datasource is selected, a filter can be applied. No stored procedure is needed when using SmartObjects and SmartForms.


 


Regards.

Badge +2

Hi,

 

I can see the filters but i want to limit the number of results as well. I cannot find any such filter. So should i write a stored proc?

Badge +6

Hi,


 


Yes, it seems like using a stored procedure would be your best option in this case.

Badge +4

Stored procedure or a view would be the way to go in this case. Also, if you are querying a large table, this is best for performance as you are guaranteed that K2 is not going to pull more rows than you are actually going to need to display.

Reply