Skip to main content
Question

How to access current value from list for more complex sort

  • September 28, 2022
  • 3 replies
  • 99 views

Forum|alt.badge.img+5

I’m trying to create a complex sort based on values in the JobList. I need to access the current values from some of the fields on the list. I thought getCurrentListRowControlValue would get me access but I am getting “Exception: currentListRowContainer object cannot be null.”

Is there a function that can get me access to the current row within a Sort script on mobile?  Not sure if this is even possible, but without it I’m not sure how scripts would be used for sorting on mobile.

3 replies

Lee Pinchbeck
Ultimate Hero
Forum|alt.badge.img+24
  • Ultimate Hero
  • 1219 replies
  • October 6, 2022

@Steve Hurst Do you have any ideas on this one?


Forum|alt.badge.img+15
  • Hero (Employee)
  • 55 replies
  • November 1, 2022

As fas as I know this is not possible as the list can only have values changed. You cannot add rows to the list or sort it via scripts.

It is however possible to create custom sort options on the Job List screen but these only sort by a column on the data. Would it be possible to use a user_def field on the task record to hold the sort value? If so, you could then create a new sort item using this user_def field. It might also then be possible to use the populate script to update this user_def field with a sort value via the script and so create the sort field dynamically via the script.


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Employee)
  • 11 replies
  • November 18, 2022

I’ll give that a try, but is the sort added to the SQL query retrieving the data from the mobile database? If so we’ll need to set the user_def before the data is retrieved. I’ll report back with my results. Thanks in advance!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings