- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 10:18 PM
Hi Team ,
only for particular catalog
We want make this SCTASK00001 ( as a url ) if user clicks on that means it has to redirect to that sctask .
In the same SCTASK we are populating this message in worknotes also . in worknotes also it has to be url
can anyone please provide me step by step solution to achieve .
Please provide screenshot for better understandig
thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 12:13 AM
Just put quotes around sc_task
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+'sc_task' + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + workflow.scratchpad.task_number + '</a>[/code]';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:22 PM
If you put
href = 'sc_task.do?sys_id=-1'
Then it will take you to new record
you should pass something line sc_task.do?sys_id=<required task's sys id>
for a specific task, if you have number in scratchpad, then look up with that number to get the sysid of respective task and then pass it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:30 PM
Hi @Aman Kumar S @Sonam_Tiwari
I am getting this below value please help me with code
My requirment is to get the 1st - sctask number ( URL ) on the second Sctask worknotes .
@Aman Kumar S @Sonam_Tiwari Please provide code for more better understanding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:39 PM - edited 11-26-2023 11:39 PM
var gr = new GlideRecord('sc_task');
gr.addQuery('number',workflow.scratchpad.task_number); // assuming workflow.scratchpad.task_number has the 1st task's number in it
gr.query();
if(gr.next()){
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+sc_task + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + workflow.scratchpad.task_number + '</a>[/code]';
}
task.work_notes = url;
Adjust accordingly, haven't tested yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 12:03 AM
After updating with your code getting error .
can this code we can use in workflow ?
Please give code which i can update in workflow . so that we won't get any error .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 12:13 AM
Just put quotes around sc_task
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+'sc_task' + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + workflow.scratchpad.task_number + '</a>[/code]';