I am trying to create a search for sales orders cr...
# administration
s
I am trying to create a search for sales orders created via a channel or custom field if there’s no created for the past hour, how do I create the criteria for the past hour?
k
To me this sounds like trying to solve a problem the wrong way. What are you trying to fix?
s
The user just wanted to be notified if there’s no orders created for a specific channel for the past hour
k
Ok. - but why? is there some integration they are trying to monitor to make sure it's not failing? Is it to make sure someone is logging orders like they should be?
I mean, you could write a script for this - but I can't put enough of a business case to justify spending the time/money
n
I've used a search criteria ({today} - {date created} )< 1/24 to show orders of the last hour.
k
The problem is looking for the absence of transactions for this sales channel. You can't do this and have it only generate emails when it's been an hour since the last transaction was created.
At least, not with a saved search.
s
Yeah..I offered the user to write a script but they don’t want it to be complicated so they can modify it in the future trying to use this in my criteria but I am not able to add it for some reason CASE WHEN TO_CHAR({datecreated}, ’HH24′) = ‘01’ THEN 1 END
n
that method is going to return you orders created in the first hour of the day. If you do a Formula (numeric)
{today} - {date created}
you will be returned a number represented the elapsed time since the transaction was created. Then use you criteria as a decimal of one day. <0.0416 will be transactions created in the last one hour.
k
You are still glazing over the whole can't do a saved search for the absence of something.
n
Good point on the absence. Given the non-scripted constraint maybe a saved search with columns showing last hour, hour before, 2 hours ago.
s
Yeah.. it started to get annoying but I can’t say no or decline unless it is proven to be an enhancement or something. So somehow have to deliver something. I think their main need for this is there are different channels of sales and they particularly wanted to this as an alert to specific stakeholders or something like that. I also saw a couple of other searches needed but checking the SO’s from a different integration etc In my case, the channel is from their website. Most articles or stuff online points to displaying the results per hour and having trouble applying the same logic to the criteria..