33 views

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:

if (newValue < start_date)
{
g_form.showFieldMsg('outage_end', getMessage("Outage End Date must be after Outage Start Date.), "error");
}
 
 
TO:
if (newValue < start_date){
getMessage("Outage End Date must be after Outage Start Date.",function(msg)
   {
g_form.showFieldMsg('outage_end', msg, "error");
})
}

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.showFieldMsg('outage_end', msg, "error");

g_form.setValue('outage_end','');

 

Add setvalue before showFieldMsg:

g_form.setValue('outage_end','');

g_form.showFieldMsg('outage_end', msg, "error");

 

Article Information

Last Updated:2018-09-20 13:33:15
Published:2018-09-20