Display connect Estimated Delivery Date

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2023 03:15 PM
I have multiple request items using the same workflow. Each one has a different delivery date. How can I show the correct estimated delivery date on the portal without having to create workflow for each different time frame?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2023 04:27 PM
Hi Brian,
Within the workflow, have you associated a timeframe for the various activities which calculate together to give the estimated delivery date? When you say each one has a different delivery date...are you meaning they were all ordered at the same time and so you're expecting to see the same delivery date?
Please mark reply as Helpful, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2023 04:30 PM - edited ‎01-27-2023 05:45 PM
No I mean if I just order one I want to see the correct delivery date. However they all use the same workflow and unless there is something new I missed you can only set one duration in the workflow properties.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2023 06:37 PM - edited ‎01-27-2023 06:38 PM
Hi,
Ah, whoops, sorry I misread what you said.
For what you're trying to do, since they all use the same workflow, that "expected time" overrides any "delivery time" specified on the individual catalog items.
To workaround this, you can consider adding a run script activity in the beginning of the workflow to dot-walk to your catalog item's delivery time and then set the date with that. That way it uses the catalog item to drive delivery dates versus the workflow. Here's an example script I tested with that works and shows on the portal in the summary as the user checksout.
var dtGD = new GlideDateTime(current.cat_item.delivery_time);
var seconds = dtGD.getNumericValue() / 1000;
var openedGlideDate = new GlideDateTime(current.opened_at);
openedGlideDate.addSeconds(seconds);
current.setValue('due_date', openedGlideDate);
Upon testing, it does seem you'll also need to the Glide to the associated Request record and also set the value there too. This is a better approach, in my opinion, than trying to do it via business rule because of the way the checkout process operates. Up to you!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2023 07:49 AM
That does not seem to change the display time in the system. The portal still shows the default of 1 day. At this point is the workflow even technically attached.