- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:37 AM
Hi, I'm looking to not display some mandatory fields in certain scenarios. I will fill them with "n/a" just so that the form can be submitted.
I've tried this with a non-mandatory field an it has worked ok.
function onLoad() {
If (matches conditions){
g_form.setDisplay('description', false); //works
g_form.setDisplay('u_what_are_the_benefits_of_imp',false); //doesn't work
}
}
But when trying the same with some other fields its not working. I'm guessing because they are mandatory?
Is there a way around this?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:41 AM
If there is a mandatory field you cant make it read only or hide it, so before you have to hide you make the field non mandatory.
Similarly, if a field is read only you cant make it mandatory, you first need to make it editable n then make it mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:41 AM
If there is a mandatory field you cant make it read only or hide it, so before you have to hide you make the field non mandatory.
Similarly, if a field is read only you cant make it mandatory, you first need to make it editable n then make it mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:43 AM
so you use
If (matches conditions){
g_form.setDisplay('description', false); //works
g_form.setMandatory('u_what_are_the_benefits_of_imp', false);
g_form.setDisplay('u_what_are_the_benefits_of_imp',false); //doesn't work
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:42 AM
Hi Garry,
For a change, try hiding the fields using the page layout slush bucket,
If you are filling in the mandatory fields onLoad, then it will be the best option.
For other cases also it is an easy option, only if you are trying to display the field on some condition and hide them for some other condition,. then its not a possibility using layout, in all other cases it works fine.
Hope it helps,
Abhinav Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 02:43 AM
Hi,
As far as I know a mandatory field will still show on a form. What you need to do is a client script which makes the mandatory field non mandatory and thereafter hide it from the form.