I had a business requirement to update "Company Name" next to user name on task activity Log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2024 11:44 PM - edited ‎08-05-2024 12:41 AM
My team had a business requirement to update dynamic company name next to user name based on user's company on activity logs without modifying Dictionary. Please refer image in place of line we want to update company name or else do we have any way to show a popup view on activity log of user name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 01:08 AM
Hello @Sachin Mathew ,
You can below code in your BR (after update) -
var companyID = gs.getUser().getCompanyID(); //get sy_id of company
var coreCom = new GlieRecord('core_company');
if(coreCom.get(companyID)){
current.work_notes = coreCom.name;
}
Hope it helps.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 01:15 AM
We tried BR below screenshot is output. We don't want to update that in next line instead of that we want the Company name next to our name(Yellow highlighted).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 01:38 AM - edited ‎08-05-2024 01:38 AM
Hello @Sachin Mathew ,
Then this code piece needs to be Journal Entry (sys_journal_field) table (Before insert).
You have to concatenate the logged in user company name (fetch it using above logic).
Note - This change would be applicable to all tables using journal fields. (To restrict it to specific table, need to write custom script but there would be performance delay.)
Kindly mark this as Accepted Solution/Helpful if it helps.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2024 12:31 AM
Hi @Shubham Garg
Can you please share me where to concatenate the value of Company in 'sys_joural_field' table because we don't see any user related info there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2024 01:25 AM
Hello @Sachin Mathew ,
Journal Entry table [sys_journal_field] does contain a reference to the table record on which comment/work notes are updated.
That table reference has to be Glided and dot walked to get the user info.
https://<instance>.service-now.com/sys_dictionary_list.do?sysparm_query=name%3Dsys_journal_field&sysparm_view=
Hope it helps.
Regards,
Shubham
