- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 06:05 AM
Hello All,
My Requirment:
Under Form Section almost 15 fields are available and we need to hide them based on the selected category.
And also few fields are mandatory before saving the form and few fields are mandatory after saving the form.
we tried UI policy to make fields mandatory before and after saving the form and it's working perfectly with the conditions.
But we're unable to hide the fields based on the selected category, it's showing all the fields irrespective category.
OR
We want to Hide the section and display the section based the selected category.
Advance thanks....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 01:09 AM
HI All,
Thanks you so much for all your inputs.
Instead of hiding and showing the fields we hide the section And display the section with the required fields based on the category.
Below script we tried in Ui policy to hide the section.
Condition : Category is X
if true:
function onCondition() {
g_form.setSectionDisplay('section_name',false);
var sections = g_form.getSectionNames();
for(var i=0; i<sections.length; i++)
{
if(i == '0')
{
g_form.setSectionDisplay(sections[i],false);
g_form.setMandatory('incident',false);
g_form.setMandatory('inc',false);
g_form.setMandatory('vehicle',false);
}
}
}
If False:
function onCondition() {
g_form.setSectionDisplay('section_name',false);
var sections = g_form.getSectionNames();
for(var i=0; i<sections.length; i++)
{
if(i == '0')
{
g_form.setSectionDisplay(sections[i],true);
g_form.setMandatory('incident',true);
g_form.setMandatory('inc',true);
g_form.setMandatory('vehicle',true);
}
}
}
Once again thank you All..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 06:13 AM
Hi,
Hiding of the fields should also be possible with a ui policy, that is the best way to do it.
Can you show the ui policy you have written to hide the fields based on category?
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 06:18 AM
Hi Anurag,
Thanks for the reply
we tried to hide the fields through UI policy and it's working, but the problem is we want few fields to be mandatory Before and After saving the form based on the category.
SO we tried using UI policy to make fields mandatory Before and After saving the form based on the selected category and it's working perfectly.
But at same to we want to hide the fields based the selected category.
so for that UI policy is not working and then we wrote client script to hide the fields but it's not working.
Advance thanks....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 06:18 AM
You should be able to do this with UI Policies. However with Mandatory fields after save you will need an extra condition. Maybe crate a field (true/false) that gets set by a business rule after the record is save and then use that to make the fields mandatory when that field becomes true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 06:21 AM
Hi Brian,
Thanks for your time...
SO we tried using UI policy to make fields mandatory Before and After saving the form based on the selected category and it's working perfectly.
But at same to we want to hide the fields based the selected category.
Advance thanks....