Issue
Symptoms
Error/Warning message will not display when we use addErrorMessage() or addShowmsg() on portal. Client script will run and message will appear and dissappear.
On console, warning is displayed when replicating the issue: synchronous use not supported in Mobile or Service Portal unless message is already cached
Release
Jakarta, Kingston, London
Cause
getMessage() has a second parameter client side, a callback function
Resolution
Adding callback function to the getMessage function will resolve the issue,
For example, change, if condition:
FROM:
Additional Information
-- Check this doc about about supported client side API's look under GliderRecord class.
-- If this is not your solution but symptoms are same. Check if your client script have "g_form.setValue('<field>',' ')" or clearvalue(). These method clear or set the value and also clear the message. Make sure add these lines before g_form.showFieldMsg()
Example:
This will clear the message and value both:
g_form.setValue('outage_end','');
Add setvalue before showFieldMsg:
g_form.setValue('outage_end','');