- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 10:27 PM
In problem record, hide the Notes section
when state is equal to '102'. onChange Client script - Conditions
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 10:38 PM
To hide your sections is pretty simple. create your UI Policy and Add a condition when state is '102' and make sure to check run Scripts In your true/false sections add your code:
True:
function onCondition() {
g_form.setSectionDisplay('notes', true);
}
False:
function onCondition() {
g_form.setSectionDisplay('notes', false);
}
Regards,
Sid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 11:48 PM
Hi @Rajkumar Bommal ,
I tried your problem in my PDI and it works for me please create UI Policy and apply filter condition like - state is assess
Add below code
function onCondition() {
alert("from UI Policy");
g_form.setSectionDisplay('notes', false);
}
Result
State is Asses and there is no Notes section available
When state is not asses it shows notes section
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 10:38 PM
To hide your sections is pretty simple. create your UI Policy and Add a condition when state is '102' and make sure to check run Scripts In your true/false sections add your code:
True:
function onCondition() {
g_form.setSectionDisplay('notes', true);
}
False:
function onCondition() {
g_form.setSectionDisplay('notes', false);
}
Regards,
Sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 10:39 PM - edited ‎05-30-2024 10:41 PM
you can use the below code
if (isLoading || newValue === '') {
return;
}
if(newValue == 102){
g_form.setSectionDisplay('notes',false);
}
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 11:04 PM
@dgarad
No its not working
Notes section displaying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2024 11:33 PM - edited ‎05-30-2024 11:34 PM
change Onchange client script to onLoad
function onLoad() {
//Type appropriate comment here, and begin script below
var state= g_form.getValue('state');
alert(state);
if(state== 102){
g_form.setSectionDisplay('notes',false);
}
}
Thanks
dgarad