- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 01:48 AM - edited 12-19-2024 02:08 AM
i am passing value from client side to ui page like below.
var gdw = new GlideDialogWindow('ui page');
        gdw.setSize(750, 300);
        
        gdw.setPreference('abc',g_form.getValue('abc')); // abc is choice value
        gdw.setPreference('xyz',g_form.getValue('xyz'));	// xyz is datetime value
        gdw.render();
Ui Page code
<select id="xyz" name="xyz" >
  <g:options choiceList="${choiceList}"  />
</select> 
<g:evaluate var="abc"  expression="RP.getWindowProperties().abc"/>
<g:ui_date_time name="DateTime" field='abc' value="${abc}"/> 
Date is not populating but when i tried with gs.getDateTime() then its working withn current date.
@Ankur Bawiskar @Runjay Patel @Brad Bowman
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 08:15 AM
Hi @Suman Kumari ,
To set the choice list use code like below. You can take reference from OOB ui page "edit_link_popup".
<g:evaluate>
      var relTypes = new GlideRecord('cmdb_rel_type'); // replace with your table
      relTypes.orderBy('parent_descriptor');
      relTypes.query();
    </g:evaluate>
<select id='select_relationship_type'>
         <j:while test="${relTypes.next()}">
            <j:choose>
              <j:when test="${relTypes.sys_id==${RP.getWindowProperties().get('xyz')}}">
                 <option value="${relTypes.sys_id}" selected="selected">${relTypes.name}</option> // replace with your field name
              </j:when>
              <j:otherwise>
                 <option value="${relTypes.sys_id}">${relTypes.name}</option>
              </j:otherwise>
            </j:choose>
         </j:while>
         </select>
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 08:15 AM
Hi @Suman Kumari ,
To set the choice list use code like below. You can take reference from OOB ui page "edit_link_popup".
<g:evaluate>
      var relTypes = new GlideRecord('cmdb_rel_type'); // replace with your table
      relTypes.orderBy('parent_descriptor');
      relTypes.query();
    </g:evaluate>
<select id='select_relationship_type'>
         <j:while test="${relTypes.next()}">
            <j:choose>
              <j:when test="${relTypes.sys_id==${RP.getWindowProperties().get('xyz')}}">
                 <option value="${relTypes.sys_id}" selected="selected">${relTypes.name}</option> // replace with your field name
              </j:when>
              <j:otherwise>
                 <option value="${relTypes.sys_id}">${relTypes.name}</option>
              </j:otherwise>
            </j:choose>
         </j:while>
         </select>
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 08:59 AM
Thankyou so much @Runjay Patel.
