The Now Platform® Washington DC release is live. Watch now!
‎04-15-2015 12:17 AM
Hi All,
We are making some fields mandatory on click of one UI action button. It is working fine when the form is fully loaded but if we click this button in onLoad it self then it is not asking for fields mandatory its going to next step.
Can we over come the issue in any way?
‎04-15-2015 02:14 AM
Hello Sannavulla,
I will suggest that you should not allow any mouse clicks while the form is loading. You can show a loading dialog message during the form load. For that you can use javascript "setTimeout()" method. Use the below link as reference.
Sleeps, Delays, or Waits in Client Scripts - ServiceNow Wiki
Hope that helps.
‎04-15-2015 03:31 AM
That script is not working for UI action.
‎04-15-2015 03:43 AM
You need to put that piece of code in the onload Client Script of the Form you are using. It should be something like below:
=================================
function onLoad()
{
// Wait for 1 second
setTimeout(myFunction,1000);
}
function myFunction()
{
// do your stuffs here
}
=================================
Let me know if this works.
‎04-15-2015 04:30 AM
I tried like above but I am able to click that UI action button and it is not asking for mandatory fields.