Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!

addMonths in calculated field

Avatar

Level 6

Has anyone used addMonths in a calculated field based on another date field?

Example: ADDMONTHS(Closing Date - Calculated;18)

When I add this expression to the custom form I get an error. I've tried the above example as well as wrapping the field name in {}.

0694X00000IAxLTQA1.png

6 Replies

Avatar

Employee Advisor

Amanda - just to help clarify, are "Closing Date" and "Calculated" two different custom form fields in your system?

And what format are they? I imagine "Closing Date" is a date field, but what type of field is Calculated?

If you just wanted to calculate 18 months from the Closing Date field, you would use ADDMONTHS(Closing Date,18)

Let me know!

Avatar

Level 6

Nichole. Thanks for your help. It’s all one field “closing date - calculated”. I tried wrapping it in {} since it has a dash in it. No luck.

Avatar

Community Advisor

sounds like Nichole was hinting you should use a comma rather than a semi colon?

Avatar

Level 6

Skye. Also tried a comma. No luck. The Workfront documentation shows a semi colon‚Ķdoes seem like it should be a comma. In the expression I had comma didn’t work.

Avatar

Community Advisor

if it's helpful to know my troubleshooting steps, here's what I usually do:

1) try and get the syntax working with a field provided by workfront. In this case, I got the following working: ADDMONTHS(Planned Completion Date,18) -- planned completion date being a workfront default field.

2) try and get the syntax working with a custom date field that doesn't have a funky name. This also worked for me, I just randomly picked one of our custom fields, "creative due date" and got it to work with ADDMONTHS(creative due date,18)

3) try and get it working with your funky name field. In this case I just randomly picked a date field with dashes in it, and got it working, using similar syntax. ADDMONTHS({my fieldname in curly braces},18)

At this point, your best bet would be to record yourself doing these steps and them not working, and submitting a ticket to the helpdesk. This always nets me a pretty immediate (and helpful) response.

The semi colon definitely threw an error on my side as well. I'd probably use the megaphone icon and let the writers know.

Avatar

Employee Advisor

Skye - those are GREAT steps.

Amanda - if you are unable to get the field working using the curly braces like Skye mentioned, please submit a case to Customer Support - they should be able to troubleshoot that issue!

I will also work with our internal documentation team to get any (and all) articles that reference a semi colon in the expression updated1