Bulk Transferring Assets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:20 PM
I have a question regarding transferring assets between stockrooms via transfer orders in the HAM application.
Example: I have 100 computers (non consumable assets) that need to be transferred from stockroom A to stockroom B.
The out-of-the-box functionality requires me to create a transfer order line for each asset individually. This is very tedious and time consuming. Is there any way to link multiple assets to 1 transfer order line / bulk create the lines?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 02:07 AM
Same question here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 02:43 AM
Yes, you can achieve this by creating a custom script to automate the process. Here's a high-level overview of how you can do this:
1. Create a new UI Action on the Transfer Order form.
2. In the script section of the UI Action, write a script that will:
- Fetch all the assets that need to be transferred.
- Loop through each asset and create a new Transfer Order Line record for each one.
- Link each Transfer Order Line to the Transfer Order.
3. Save the UI Action.
4. When you need to transfer multiple assets, you can simply select them and then click on the UI Action to automatically create the Transfer Order Lines.
Here's a sample script that you can use as a starting point:
javascript
var assets = new GlideRecord('alm_asset');
assets.addQuery('stockroom', 'stockroom_A_sys_id'); // replace with the sys_id of stockroom A
assets.query();
while (assets.next()) {
var transferOrderLine = new GlideRecord('alm_transfer_order_line');
transferOrderLine.initialize();
transferOrderLine.transfer_order = 'transfer_order_sys_id'; // replace with the sys_id of the transfer order
transferOrderLine.model = assets.model;
transferOrderLine.quantity = 1;
transferOrderLine.insert();
}
Please note that this is a simplified example and you may need to adjust it to fit your specific needs. Always test custom scripts in a non-production environment first.
nowKB.com
For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER