The CreatorCon Call for Content is officially open! Get started here.

UI action - onLoad issue

mdsannavulla
Kilo Guru

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?

25 REPLIES 25

Hi,


Yes. you can write a Onload script for this.


This may help you.


https://community.servicenow.com/thread/163011


I tried this in onLoad but I am able to click the button and it is not asking for mandatory fields, it is moving to next step



function onLoad()


function hideSaveMoveToNextStepButton(button) {  


//Remove the 'Close Task' button  


var items = $$('BUTTON').each(function(item){  


if(item.innerHTML.indexOf(button) > -1){  


item.hide();  


}


});


}


}


Hi,


Use this onload client script. You can see the buttons id using inspect element.


function onLoad() {


$('YOUR BUTTON_ID').hide();


}


Tried this but it is not working. Because of this UI policies are not working on the form.


Can you show the code which you used to hide the macro