- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 05:50 AM - edited 07-08-2025 06:08 AM
Hi everyone,
I've created an associated "wm_task" button so that when clicked, a form appears, which can then be filled out for validation. The form doesn't appear in the fsm portal, but it does show the work note. From the backend, I've verified that the survey instance is generated, but it says I have no questionnaires.
I have only created the survey and associated a couple of fields to make a draft through the Survey Designer module. Any idea why this appears to me?
(new sn_assessment_core.AssessmentCreation()).conditionTrigger(current, '...');
var grAsses = new GlideRecord("asmt_assessment_instance");
grAsses.addQuery("trigger_id", current.getUniqueValue());
grAsses.orderByDesc("sys_created_on");
grAsses.query();
if (grAsses.next()) {
grAsses.setValue("user", gs.getUserID());
grAsses.update();
}
if (current.isValidField('work_notes')) {
current.work_notes = 'Encuesta técnica lanzada desde Validar';
current.update();
}
action.setReturnURL(current);
action.setRedirectURL('....' + current.sys_id + '&sysparm_tablename=wm_task');
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 05:59 AM
you are not redirecting user to the generated assessment
is this for work order or work order task?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 06:32 AM
@tomaslindev it's maybe unrelated but review the URL structure:
the uri part doesn't seem to be correct:
I would focus on the redirect address. First go to the table/location where you want to be redirected and then adjust the script to be pointing there... this seem to be a flaw that instead of calling the system property with URI it is in the address as string
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 05:58 AM
Hi @tomaslindev,
first of all, you should not display customer's name (URL) please hide it or make screenshot without URL next time, it is a good practice not to share this...
also, do you know that you have any questionnaire for the logged in person? You are redirecting to this table:
action.setRedirectURL('fsm_questionnaire_list.do?sysparm_show=' + current.sys_id + '&sysparm_tablename=wm_task');
Do you have there any records? Try impersonating or create some demo/test data to verify this functionality
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 06:23 AM
Good to all,
I thought it was thrown out in this way because a button had happened to me but it doesn't work that way, I've seen what it does
As this goes through the FSMCP portal, it works differently to...
You have to create an empty UI Action and in the Application of Field Service Contractor Management, and then what the button does not go in the UI Action, it goes in the widget that uses the page, and the widget is that of FSM Redirect Uiaccion and in the part of the Server Script is where you put the logic by the last one Action name that you put to the UI Action and there and if it would be something similar to how I have put the code. I had never seen it mounted that way I don't know if you @Ankur Bawiskar and @GlideFather ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 06:32 AM
@tomaslindev it's maybe unrelated but review the URL structure:
the uri part doesn't seem to be correct:
I would focus on the redirect address. First go to the table/location where you want to be redirected and then adjust the script to be pointing there... this seem to be a flaw that instead of calling the system property with URI it is in the address as string
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 05:59 AM
you are not redirecting user to the generated assessment
is this for work order or work order task?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader