I am able to run script below in SQL (the select part of it) and it returns the results as expected; however on Mobile the line-code field is greyed out and won’t allow selections. I have confirmed that user_def1 is passed down to mobile.
This is something i’m doing in order to filter out select line codes from appearing on Mobile screen.
populateListFromQuery("non_part_usage", "line_code", "select description, line_code from line_code where npu_code = 'EXP' and line_code_type <> 'CYL' and line_code_type <> 'R'and user_def1 <> 'PR' order by sequence asc", true);
Hi
Are you able to provide a bit more detail on what you are trying to do?
Which screen re you applying this script to? I assume it is in the populate event?
Have you modified the line_code field?
Maybe some screenshots might help?
Regards
Steve
Hi
Usually you would use the mobile designer to apply filters like this one.
Have you tried the mobile designer? Is there an issue you have hit that has made you look somewhere other than the designer?
Kind regards,
Lee Pinchbeck
Hi
I”m running a client script to populate the ‘Fees’ (DebriefMileage) screen on mobile with only select Line Codes - those with the field ‘user_def1’ not populated with ‘PR’, see 1st screenshot. The script runs fine in SQL only returns those line codes that do not have ‘PR’, however when i refer to this in my refresh script to populate values, it greys out the line code selection field on mobile - so it doesn’t like the “...user_def1 <> ‘PR’..” in the populateListFromQuery line
Hi
Hi
The problem is being caused because some of your line code records have NULL values in user_def1. Mobile treats these differently. In order to fix your sql query in your script you need to replace your populateListFromQuery line with the following which adds in specific handling for null values:
populateListFromQuery("non_part_usage", "line_code", "select description, line_code from line_code where npu_code = 'EXP' and line_code_type <> 'CYL' and line_code_type <> 'R' and (user_def1 <> 'PR' or user_def1 IS NULL) order by sequence asc", true);
This should then work.
Regards
Steve
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.