New to Workflow Formula’s In a case where I want t...
# general
c
New to Workflow Formula’s In a case where I want to {custbodycs_planned_fill_end_date} + 10 days how would I write that expression so it sets value field for a custom date field?
a
{custbodycs_planned_fill_end_date} + 10 (assuming the above field is date format)
c
It is and I tried that but it just returns {custbodycs_planned_fill_end_date} in that new field
a
What field type is that custbody field, and what field type is the new field.
c
Just checked and they are both date fields
Ive tried {custbodycs_planned_fill_end_date} , 10 and then it just skips over the field ID and writes 10 in I tried addday and it doesn’t work. I just don’t know why it’s not simple
m
I've always used {datefield} + 10 and it works fine...what is your trigger set to? Can you send a screen shot of the parameters of the Set field value action?
c
My state triggers and parameters are attached
My WF event def is below
m
Oh I've never gotten calculations to work using the Client triggers. It will work if you use Before Record Submit or After Record submit, but Client triggers seem to have this limitation
c
So I need to change the state trigger to after record submit for it to take the + 10?
m
The trigger in your Set Field Value action
c
Right. Okay. I’ll do that now
I wish it was more dynamic then after the fact
m
You can also use Before Record submit, but essentially would be the same user experience as After Record submit, just less performance impact
slightly
Yes for some reason it seems you need the server to provide the calculation, so you need to use a server trigger
c
So whenever I’m doing calculations like that it can’t be on a client trigger? When would be a scenario of a client trigger?
m
Correct, it seems like the Server is required to make calculations. CLient Triggers are Before User Edit Before Field Edit After Field Edit After Field Sourcing Before User Submit
Server Triggers are Before Record Load Before Record Submit
After Record Submit
c
This is super helpful. I’m going to read more about it
m
Here's a post I wrote about it
if your interested
🙌 1
c
I am
m
This one also has a nice table that lays out how each trigger functions as well
w
I think you can use suitescript in the formula field for clienttriggers.
Perhaps only SS1.
Server trigger = SQL Formulas Client trigger = Suitescript
@Chris
Copy code
nlapiDateToString(nlapiAddDays(nlapiStringToDate({custbodycs_planned_fill_end_date}),10))