How can I show an assessment on a form by clicking UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 03:02 AM
Hi all,
I created an assessment and I would like it to show on a form, by clicking a UI action(link) and then for users to submit it. How can I achieve that?? Anyone can help with script?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 04:09 AM
Create a UI Action Button on the Form or Table where you need.
Write this UI Action Script
function onClick() {
var ga = new GlideAjax('global.customSurveyUtil');
ga.addParam('sysparm_name', 'createSurvey');
ga.addParam('sysparm_tablename', g_form.getTableName());
ga.addParam('sysparm_sysid', g_form.getUniqueValue());
ga.getXML(ajaxResponse);
function ajaxResponse(serverResponse) {
var answer = serverResponse.responseXML.documentElement.getAttribute("answer");
//window.open(answer, "Feedback", "width=600,height=500,toolbar=yes,scrollbars=yes");
g_navigation.openPopup(answer);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 04:22 AM
Hi @Samaksh Wani , where in this code above you provided, should I add the name of the survey I have already created and also the table name where is stored?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 04:26 AM
Name of the Survey you need to add
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 04:51 AM
Do you know where exactly I will need to add this in your code? Thanks