ECC Pro: Estimated Delivery & Delivery Date

Josh Pirozzi
Kilo Sage

On the Request Summary page there are the options for 'Estimated Delivery' and 'Delivery Date' that we are trying to have display separate dates, but are running into difficulty locating and linking the HTML/Scripting to display the dates correctly. 

 

We're currently using the OOTB 'SC Order Status' Portal Widget and, because of the read-only policies, haven't made any adjustments to the widget functionalities. For our purposes, I'll be making a clone of the OOTB widget and only modifying the data that populates for the 'Estimated Delivery' and 'Delivery Date' fields. What we're trying to achieve is:

 

  • On 'Estimated Delivery': Display the total number of anticipated days for completion of a request item. This is currently driving from the Days entered within the Flow, and is working as expected.
  • On 'Delivery Date': Display the Date the RITM has been completed. What is currently displaying is the same data as on 'Estimated Delivery' and we're unsure what aspect(s) of the widget would need to be updated and how to pull the Date from the RITM Completed Date/Time field.

 

7 REPLIES 7

Mallidi Suma
Tera Guru

Hi @Josh Pirozzi ,

 

I achieved this by customizing the SC Order Status Widget. Please find the below steps:-

1. Create a cloned copy of the SC Order Status widget.

2. Remove the SC Order Status form Instance 2 and  Add the cloned widget to the Order Status Page.

Screenshot 2023-05-21 at 1.20.21 AM.png

3. Now go to the Widget Editor of the Cloned Page and go to its Server Side Script. 

Paste the below code after 140 line

 

var closedDate; 
if(reqItemGr.closed_at)
{
closedDate = reqItemGr.closed_at.split(' ')[0]; // If RITM is closed then delivery date will be the Closed date of RITM
}
else
{
closedDate = ''; // If it is not closed then it will show empty
}

//If you wanted to sort it down further with the catalog item name you can do that by using reqItemGr.cat_item = //'sys_id" of your catalog item.

 

Replace the line number 145 (delivery_date: ritm.getDeliveryDueDate(),) with the below line

delivery_date: closedDate,

MallidiSuma_0-1684612792736.png

 

I believe another approach to do this without cloning the widget is to find the definition of this statement delivery_date: ritm.getDeliveryDueDate(),  in the server-side code.

 

Please mark my answer as helpful and accept it as a solution, if it helps you !!

 

Thanks & Regards,

Suma.

Thank you @Mallidi Suma !!

 

Your detailed notes were perfect, and the Estimated Delivery is displaying the number of days from the date submitted, but for some reason when a RITM is closed the date isn't carrying from the RITM 'closed_at' to display on the Order Status Portal Widget. I've gone through to investigate and confirmed that your script is correctly looking for the 'closed_at' field when it's populated, but I'm unsure why the date isn't carrying over. 

 

Is it possible that I mis-typed the script into the widget?

Hi @Josh Pirozzi ,

 

Please upload the below XML's new widget. One XML is for the widget and another one will add the newly created Widget to the order status Page.

 

Upload the 2 XMLs and test them again.

 

Please mark my answer as helpful and accept it as a solution, if it helps!!

RodGallegos
Tera Guru

@Josh Pirozzi I would suggest adding a log statement in your code to ensure you are getting something for closed_date

 

var closedDate; 
if(reqItemGr.closed_at)
{

gs.info("Closed at date is: ", reqItemGr.closed_at) // Add this line
closedDate = reqItemGr.closed_at.split(' ')[0]; // If RITM is closed then delivery date will be the Closed date of RITM
}
else
{
closedDate = ''; // If it is not closed then it will show empty
}

 

Otherwise, you may want to check the Restricted Caller Access list and see if you're running into any cross scoping issues and mark the record(s) as "Allowed".