hello! i am working on a workflow, and i'd like to...
# suiteflow
n
hello! i am working on a workflow, and i'd like to set a value if a custom datetime field value is greater than 1 day ago. i am thinking this should be a before/after record submit action. i've tried {today}-{customdatefield}>=1, but i am not having any luck. please help
also tried this formula: TRUNC({custbody_last_dnal}) <= TRUNC({{custbody_today})-1)
t
How does this customdatefield display?
n
date and time. ex: 10/29/2024 11:24 am
t
If it's a date & time field (showing both) I wouldn't be suprised if it's not calculating that
Because the {today} field is just a date?
n
i have another custom field that has today's date and time - but no luck there, either
t
I know for a fact that you subtract just date fields, I have multiple Saved Searches that do that.
But I highly doubt you can subtract a date/time from a date
I'm not even sure if you can subtract a date/time from a date/time
n
i am thinking that is the issue...
t
So if you redo your custom date/time field and change it to a date you should be able to subtract it from {today}
n
there's no way i can convert a datetime field to a date in a formula?
t
Is this a saved search condition?
Or just a formula condition in the workflow
n
workflow condition
t
I don't see a formula(numeric) in the field of the workflow conditions
Do you?
n
no
t
Do you need the time component?
n
not necessarily
t
Simple solution is just to convert the date/time into a date but there is probably other solutions.
At least we figured out the problem
I think you'll have a lot more flexibility with a saved search condition if thats possible for you
And I'd be willing to bet you convert one via formula so it would calculate date field - date field leaving out the time component.
n
i was trying not to use a saved search because the custom date field i'm looking at is a not store value field
t
You could make another WF and date/time field that can set the new date/time field on record save as a stored value
Sourcing from the original date/time field
that is non-stored
You can do workflow conditions that subtract a non-stored value from {today}?
n
in workflows, you can use non-stored values in a condition. but if i can't get the date comparison to work, i will do what you last suggested
t
Well good luck!
n
thanks so much!!
i
I have found date conditions in Workflows to be unreliable, i have a formula that works 95% of the time, the other 5% it returns invalid expression error. Even though they are for the same customer, same context, even on the same API request. I had a longstanding case with NS Support and ACS and they could not admit to the issue but where able to replicate on their side. They offered no solution. not sure if this helps any but you can wrap it around a TO_DATE and see if that works. It's too late for me to think what your logic would be but this is what I have used when checking between a date range. TO_DATE({today}, 'MM/DD/YYYY') BETWEEN TO_DATE('06/03/2024', 'MM/DD/YYYY') AND TO_DATE('06/14/2024', 'MM/DD/YYYY')
n
i tried to_date with no luck. thank you for your input, really appreciate it!