Showing trigger id record on survey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2016 09:09 AM
Our surveys are sending to the customer's after incidents and requests items are closed, but the customer's do not have a reference point. I need to show the incident or RITM number on the survey.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 08:16 AM
The trigger information is not displayed in the survey page. However, you can customize the UI page to include any kind of information you would like to display. I am not sure which survey you are using so it could be either one of them:
- the legacy survey UI page is "survey_take"
- the new survey UI page is "assessment_take2".
If you would like to use this in the new survey UI page, you could simply customize the HTML section of the "assessment_take2" UI page as provided in the sample below. The sample will allow you to show the number and the short description fields of the record triggered the specific survey instance. I have also provided a screenshot to demonstrate the output in attachment.
Before:
======
<j2:if test="$[typeof typeGR == 'object']">
<j2:if test="$[typeGR.next()]">
<div class="assessment_caption" style="margin-top: 2px;">
<img src="images/context.gifx" alt=""></img>
$[typeGR.name]
</div>
<div>
After:
=====
<j2:if test="$[typeof typeGR == 'object']">
<j2:if test="$[typeGR.next()]">
<g2:evaluate>
var instanceGR = new GlideRecord('asmt_assessment_instance');
instanceGR.get('${jvar_assessable_sysid}');
var triggerGR = null;
triggerGR = new GlideRecord(instanceGR.trigger_table);
triggerGR.get(instanceGR.trigger_id);
</g2:evaluate>
<div class="assessment_caption" style="margin-top: 2px;">
<img src="images/context.gifx" alt=""></img>
$[typeGR.name] - $[triggerGR.number]:$[triggerGR.short_description]
</div>
<div>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 12:16 PM
Hello - It appears that the assessment_take2 HTML code has changed quite a bit in Geneva. we are running patch 5, and I am not positive how to make the trigger number and short description to appear anymore. This is what the section of code looks like now:
<j2:if test="$[typeof typeGR == 'object']">
<j2:if test="$[typeGR.next()]">
<div class="navbar navbar-default" role="navigation">
<h1 class="navbar-title">$[typeGR.name]</h1>
<j:if test="${isPreview != true}">
<div class="nav navbar-right">
<g:evaluate var="jvar_no_attachment">
var gr = new GlideRecord('asmt_assessment_instance');
gr.getED().getBooleanAttribute('no_attachment');
</g:evaluate>
<j:if test="${!jvar_no_attachment}">
<j2:if test="$[jvar_can_write == 'true']">
<j2:if test="$[jvar_session.hasRole(jvar_attachrole)]">
<j2:if test="$[GlideMobileExtensions.getDeviceType() == 'doctype']">
<button type="button" onclick="saveAttachment('asmt_assessment_instance', '${jvar_assessable_sysid}');" id="header_add_attachment"
title="${gs.getMessage('Manage attachments')}"
aria-label="${gs.getMessage('Manage attachments')}"
class="btn btn-icon icon-paperclip navbar-btn" />
</j2:if>
<j2:if test="$[GlideMobileExtensions.getDeviceType() != 'doctype']">
<a onclick="saveAttachment('asmt_assessment_instance', '${jvar_assessable_sysid}');" id="header_add_attachment">
<img src="images/icons/attachment.gifx" alt="${gs.getMessage('Attachments...')}"
class="i16x16" title="${gs.getMessage('Attachments...')}" />
</a>
</j2:if>
</j2:if>
</j2:if>
</j:if>
<button class="btn btn-primary navbar-btn" type="submit" onClick="return submitAssessment();" id="submit" name="submit">${gs.getMessage('Submit')}</button>
<j:if test="${isUserLoggedIn}">
<button class="btn btn-default navbar-btn" type="submit" onClick="return saveAssessment();" id="save" name="save">${gs.getMessage('Save')}</button>
</j:if>
<button class="btn btn-default navbar-btn" type="submit" onClick="return cancelAssessment();" id="cancel" name="cancel">${gs.getMessage('Cancel')}</button>
</div>
<div style="clear: both;"></div>
</j:if>
</div>
Thank you in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 12:39 PM
Actually I think I have it...
<j2:if test="$[typeof typeGR == 'object']">
<j2:if test="$[typeGR.next()]">
<div class="navbar navbar-default" role="navigation">
<g2:evaluate>
var instanceGR = new GlideRecord('asmt_assessment_instance');
instanceGR.get('${jvar_assessable_sysid}');
var triggerGR = null;
triggerGR = new GlideRecord(instanceGR.trigger_table);
triggerGR.get(instanceGR.trigger_id);
</g2:evaluate>
<h1 class="navbar-title">$[typeGR.name] - $[triggerGR.number]:$[triggerGR.short_description]</h1>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2016 09:49 AM
Hi Hakan,
This code is causing an issue when we try to save or cancel a survey. We get this message to display after hitting either save or cancel:
Your responses have not been saved. You can complete this survey before
The date will not display at the end of the message anymore now that we added the lines of code in you suggested. Are you seeing the same issue? Any thoughts on how to resolve it?
Thank you!