How to hide fields on a form from users but keep them active in the background for automation?

thrsdy1512
Tera Expert

Kiran1512_0-1706795450538.png

Hi,

 

I am trying to hide fields on a form as the fields do not need to be visible to users, they are there for automation purposes only so they just need to be hidden from users.  I have been unsuccessful in doing this via a UI Policy. These are true/false fields.

 

Can this be done using a client script or business rule? 

 

Thank you

2 REPLIES 2

Amit Verma
Kilo Patron
Kilo Patron

Hi @thrsdy1512 

 

You should be able to do it via UI Policy itself which is the recommended way. Still, if you are facing issues, you can do it via Catalog Client Scripts as well. Use  g_form.setDisplay('name of the field',false); inside your client script.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Pratiksha2
Mega Sage

Hello @thrsdy1512 -
Please try using below onload client script:

 

function onLoad() {
    // Replace 'name_of_the_field' with the actual name of the field
    g_form.setDisplay('action_required', false);
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Pratiksha