Automation of closing delivered orders and put them in state "Closed Complete".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 01:22 AM
My task is to close orders that have not received a delivery receipt. It is about 459 orders that need to be closed. I have an excel file with three columns: Invoice number, Order number and Ref number for each order. All 459 orders are there.
These orders are from a "sc_request" table, where you can find them based on the Ref number. Is there any way to automate this job in ServiceNow by putting Request state/State to "Closed Complete" for each of these 459 orders?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 02:08 AM
Hi @ronro2
My task is to close orders that have not received a delivery receipt. It is about 459 orders that need to be closed. I have an excel file with three columns: Invoice number, Order number and Ref number for each order. All 459 orders are there.
Atul : How you are checking that for 459 record delivery receipt not received? Is any field on form? or task is still open?
These orders are from a "sc_request" table, where you can find them based on the Ref number. Is there any way to automate this job in ServiceNow by putting Request state/State to "Closed Complete" for each of these 459 orders?
Atul: As per process, task must closed and with the same RITM and REQ get closed automatically.
So if you have any field to track delivery receipt, use that in Background or flow and close the Order.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 02:26 AM
Hello @ronro2
Yes, we can update the state to 'Closed Complete', please follow below steps.
- Navigate the sc_request table.
- Copy the ref number from the Excel sheet.
- Apply a filter in the sc_request table, i.e.> ref number - is one of - paste the ref number with comma separated.
- Run the filter.
- Right-click on the filter and copy the query.
- Make sure to run in the Background script for a single record, if all is good then go for the FIX script and run for all records.
- Create a FIX Script (Make sure the RollBack checkbox should be checked) and run it.
var sc = new GlideRecord('sc_request');
sc.addEncodedQuery('paste the query here');
sc.query();
while(sc.next()){
sc.state = closed_complete// make sure you will be giving value
sc.setWorkflow(false);
sc.autoSysFields(false);
sc.update();
}
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Thanks & Regards,
Kartik Magadum