- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:12 AM
Hi all,
g_form.getParameter("sysparm_item_guid"); is not working on service portal AND
g_form.getUniqueValue() is also not working
is there any alternate way.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:58 AM
in newyork its available , without writing a single code.
Give a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 06:12 AM
what if i need the sys_id of that new record ?? i need it in my logic but

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:54 AM
to make attachment mandatory , kindly have a look on below blog. it has mentioned the steps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 02:06 AM
Hi harsha,
I tried the below code but it gives me the same alert even with or without attachment
/////client script////////
function onSubmit() {
//Type appropriate comment here, and begin script below
alert('in');
var cat_id=g_form.getUniqueValue();
//var cat_id= g_form.getParameter("sysparm_item_guid") ;
alert('id is '+cat_id);
var ga=new GlideAjax('MYSI');
ga.addParam('sysparm_name','Myfunction');
ga.addParam('sysparm_cat_id',cat_id);
ga.getXMLWait();
varc=ga.getAnswer();
if(c=="add attachment" )
{
alert(c);
return false;
}
else
{
alert("has attachment"+c);
return true;
}
}
//////script include////
var MYSI = Class.create();
MYSI.prototype = Object.extendsObject(AbstractAjaxProcessor, {
MYfunction(){
var cat_id=this.getParameter('sysparm_cat_id');
var gr=new GlideRecord('sys_attachment');
gr.addQuery('table_name','sc_req_item');
gr.addQuery('table_sys_id',cat_id);
//gr.addQuery("sys_created_on", '>=', 'javascript:gs.minutesAgo(10)');
gr.query();
if(!gr.next())
{
return "add attachment";
}
else
{
return "done";
}
},
type: 'MYSI'
});
the above code does not work for me
Portal settings section is not available on our personal project instance .I even tried to configure it but no use:(
thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 02:11 AM
i am sorry, but you have tagged "NewYork" instance so "portal setting" should be available.
if you wanna go with script , kindly have a look on below blog. it has mentioned different approach.
https://www.servicenowelite.com/blog/2017/5/12/service-portal-require-attachments