Troubleshooting Mobile UI Policy Issues
Ensure UI Policy Scripts are Set to Run in the Mobile UI
With the introduction of the Mobile UI, a new field has been added to UI Policy records called Run scripts in UI type. The options for this field are Desktop, Mobile, or Both. This field does not appear on the UI Policy form or list by default, but can be added using the steps provided in the mobile product documentation.
This field determines whether or not the scripts in the Execute if true or Execute if false fields is run. It does not have an effect on whether or not a UI Policy’s actions are run.
Make Sure Any Client Side Script is Compliant with the Mobile UI
There are some limitations in the Mobile UI that may require changes in any custom created scripts, or scripts that have been modified from their base system versions. Scripts that use asynchronous calls or unsupported methods may break down, and prevent your forms from working the way you intend.
This is important for script within your UI Policies as well as any other client side scripts that execute on the same form. When client side errors are triggered on a form, scripts stop executing. Faulty client scripts running on the form before your UI Policy can potentially stop your UI Policies from running, even when there is nothing wrong with the policies themselves.
The best way to track down any client side errors is using your browser’s developer console. Further information on this can be found in the
Debugging the Mobile UI from your Desktop community article.
Make Sure Other Elements are not Causing Changes
While UI Policies are the recommended method to make a field mandatory and visible, and conditionally read-only, there are other ways to do this. Check client scripts running on the form for any setVisible, setMandatory, and setReadOnly calls, as these might be conflicting with your policies. Also, note that a field can be made mandatory at the dictionary level, using a checkbox on the field’s dictionary entry.
Client Scripts execute before UI Policies, so they should override these calls, but this can explain, for example, why a field is invisible after you’ve disabled a UI Policy that hides it.
KB0551436: PRB602990: UI Policy conditions use sys id in mobile instead of display value (Corrected as of Eureka Patch 3)
KB0533671: PRB592512: UI policies create errors on policies with an OR condition on mobile platforms. (Corrected as of Dublin Patch 5)
KB0551437: PRB589240: [Mobile UI] UI Policy executes before client scripts (Corrected as of the Dublin Release)
KB0551440: PRB642588: Mandatory UI Policy on date/time field does not work on Mobile UI (Under Investigation)