Dynamic Me filter and gs.getUserID() not working for mobile module in scoped app

dannypatino
Kilo Expert

I'm creating an application with mobile modules.   Whenever I try to select the logged in user from the mobile module filter, it won't inject it any value. I've tried using both the dynamic filter and javascript:gs.getUserID().   Has anyone else experienced this issue and, if so, have you figured out how to get it to work?   Thanks in advance for any input.

MyWO_Mobile_2.PNG

MyWO_1.PNG

MyWO_2.PNG

MyWO_Mobile_1.png

1 ACCEPTED SOLUTION

I have seen cases where nested functions can throw this error.   To get around it, you can create a script include with a function that breaks up the code.   Here is an example:


find_real_file.png


Then in your dynamic filter option, choose this script include in the Reference script field and then set your script to mobileGetID() in my example.



PS make sure client callable is checked, I often overlook that and it causes issues.


View solution in original post

7 REPLIES 7

Good idea Brad.   I'm not sure why I hadn't thought of it.



Unfortunately that doesn't work either.   However, I do get a client-side error message stating: Illegal access to method getID() in class com.glide.sys.User.   At least I have something to search for now.


I have seen cases where nested functions can throw this error.   To get around it, you can create a script include with a function that breaks up the code.   Here is an example:


find_real_file.png


Then in your dynamic filter option, choose this script include in the Reference script field and then set your script to mobileGetID() in my example.



PS make sure client callable is checked, I often overlook that and it causes issues.


That worked!   Thank you both very much.



Takeaway: Use script includes if 'javascript:' doesn't work in filters.



I haven't had a scenario where something simple wouldn't work.   I typically resort to script includes only when there is a high level of complexity in the filter value (kind of like a sub select in SQL).