- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 10:31 PM
Hi All,
In Major Incident management, when the Incident is promoted as major incident, I need to show some additional fields(checkbox) in the pop window shown. and I have done that in UI Page. Now I need a solution to make the checkbox true based on the values selected in the form. (if the checkbox A is true in the form, then in the pop window it should be checked).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:19 AM
then it should work fine
try this once
<div class="form-group">
<div class="col-sm-10">
<label class="col-sm-2 control-label" for="mim-propose-catsystem">${gs.getMessage('checkbox A')}</label>
<g:evaluate var="jvar_checkboxA" expression="RP.getWindowProperties().cat_system"/>
<input type = "checkbox" name="mim-propose-catsystem" id="mim-propose-catsystem" checked="${jvar_checkboxA.toString()}"></input>
</div>
</div>
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 05:26 AM
are you sure the record has false value in that field -> g_form.getValue('u_cat_system')
did you check in alert?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 07:17 AM
Hi @Ankur Bawiskar ,
Yes, I am getting an alert in the form with the values either true or false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:19 AM
then it should work fine
try this once
<div class="form-group">
<div class="col-sm-10">
<label class="col-sm-2 control-label" for="mim-propose-catsystem">${gs.getMessage('checkbox A')}</label>
<g:evaluate var="jvar_checkboxA" expression="RP.getWindowProperties().cat_system"/>
<input type = "checkbox" name="mim-propose-catsystem" id="mim-propose-catsystem" checked="${jvar_checkboxA.toString()}"></input>
</div>
</div>
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:56 AM
This now works as expected. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 05:32 AM
Hi @Priyadharashin1 ,
Try with below script it should work.
UI Page HTML:
<g:evaluate var="jvar_checkboxA" expression="RP.getParameterValue('cat_system')"/>
<input type="hidden" id="checkbox_value" value="${jvar_checkboxA}"></input>
<input type ="checkbox" name="mim-propose-catsystem" id="mim-propose-catsystem"></input>
UI Page Client script:
var checkVal = document.getElementById('checkbox_value').value;
if(checkVal == 'true')
document.getElementById('checkboxA').checked = true;
else if(checkVal == 'false')
document.getElementById('checkboxA').checked = false;
Please, mark answer correct or helpful based on the impact.
Thanks,
Sudhir G.