Update manage document owner by batch
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 06:46 AM
Hello all,
I have many manage document need to update, is there a way to update by batch ?
below are the field need to update:
1. update document owner- as the original user resigned
2. set manage document permission by batch instead one by one
Please share with me, if you have any idea or did it before.
Thank you so much.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 10:10 AM
Hi there @yandp
You can update managed documents in batches using a script.
first update document owner
var newOwner = 'sys_id_of_new_owner';
var gr = new GlideRecord('managed_document_table');
gr.addQuery('document_owner', 'sys_id_of_resigned_owner');
gr.query();
while (gr.next()) {
gr.document_owner = newOwner;
gr.update();
}
Set permissions
var newPermission = 'new_permission_value';
var gr = new GlideRecord('managed_document_table');
gr.addQuery('some_condition', 'value');
gr.query();
while (gr.next()) {
gr.document_permission = newPermission;
gr.update();
}
If this helps kindly accept the response thanks much.
☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG