Need help to pass parameters to eventqueue from Portal
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 06:44 AM - edited 05-13-2024 06:49 AM
Hi All,
I am trying to insert relationship in 3 different tables as shown below from a Custom Portal widget:///
if(graddextuser2.active == true)
{
var grextuserid = graddextuser2.sys_id.toString();
var table_1 = [
{'tblname':'cmdb_rel_person', 'col1':'user', 'col2':'ci','dev_key':'newauthcaller','prod_key':'newauthcaller1'},
{'tblname':'u_m2m_sys_user_cmdb_ci_service', 'col1':'sys_user', 'col2':'u_cmdb_ci_service','dev_key':'newauthappr','prod_key':'newauthappr1'},
{'tblname':'u_m2m_from_cmdb_ci_service_watchlist', 'col1':'u_user','col2':'u_cmdb_ci_service','dev_key':'newwatchlist','prod_key':'newwatchlist1'}
]
table_1.forEach(function(element) {
var k =0;
var test = usedfor.split(",");
test.forEach(function(value){
var grCheckExistence3 = new GlideRecord(element.tblname);
grCheckExistence3.addQuery(element.col1,grextuserid);
grCheckExistence3.addQuery(element.col2, res[k]); //res[k] contains the CI sys_id
grCheckExistence3.query();
if (!grCheckExistence3.next()) {
if(input.exUser[element.dev_key] == true && value == "Development")
{
var graddRole = new GlideRecord(element.tblname);
graddRole.initialize();
graddRole[element.col1] = grextuserid;
graddRole[element.col2] = res[k];
graddRole.insert();
flagmsg = 'true';
}
if(input.exUser[element.prod_key] == true && value == "Production")
{
//gs.addInfoMessage("User has been added successfully into Prod Key");
var graddRole1 = new GlideRecord(element.tblname);
graddRole1.initialize();
graddRole1[element.col1] = grextuserid;
graddRole1[element.col2] = res[k];
graddRole1.insert();
flagmsg = 'true';
}
}
else
{
flagmsg = 'newtrue';
}
k++;
});
});
}
I need to pass table name and new user id just got created/inserted in to an event from Portal itself.
If possible, can someone help on how to achieve the same?
Like can I add gs.eventQueue(tablename, new user sysid)?
@James Chun @Dr Atul G- LNG @Abhishek_Thakur @Sandeep Rajput
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 06:53 AM
Looks like something good, any issues with this?
--
See more of my content here.
See more of my content here.