Asset assignment history on user form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2023 04:26 AM
Hello Team,
My requirement is like this:
Create a functionality to capture asset assignment history. This functionality will be developed to track asset assignment history on the user profile. On user form, a new related list will be created which captures the asset assignment history.
Can you please guide me?
Thank you.
Regards,
Kalyani Shaha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2023 05:17 AM
Hello @Kalyani21 ,
to achieve this requirement, you need write after update business rule on Asset(alm_asset) table.
after that you need to create one custom table which will hold history of assigned asset.
and then configure related list on User(sys_user) form and select that table from slush bucket.
(function executeRule(current, previous /*null when async*/) {
if (current.assigned_to.changes()) {
// Create a new record in the 'Asset Assignment History' table
var history = new GlideRecord('u_asset_assignment_history');
history.initialize();
//history.asset = current.sys_id;
history.u_assigned_to = current.assigned_to;
history.u_assigned_on = new GlideDateTime(); // Current date/time
history.u_asset_name=current.sys_id;
history.insert();
}
})(current, previous);
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers!
Thanks, and regards,
Abhijeet Pawar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2023 05:26 AM
Hi Kalyani,
This is inbuilt in servicenow. You just have to use and teach other to use the activities tab filters. I did this for my convenience when I was part of configuration management team.
Please mark my answer helpful if it helps you.
Thanks,
Pankaj kumar