☏ 01494 590428 | ✉ hello@commerceworks.net

Spring 18 Undocumented Functions?

Whilst reading through the release notes for Spring ’18 and the various comments and blogs it seems that Salesforce have started playing ‘hide and seek’ with us.

Spring ’18 has some ‘hidden’ functions that Salesforce forgot to document. 

Now this came as a shock, never been heard of before! 

No idea whether it was deliberate or just a human error but, hey, who cares, here they are.

ADDMONTHS

add-months.png

What if you need a formula to calculate a date based off another date on a record.  i.e. you need to calculate a Review Date which might be the Close Date + 6 months.

Up until now you would have needed a long drawn out formula something like this below.

months formula.JPG

So now all you need is this to add 6 months to the Close Date.

monthsf.jpg

WEEKDAY

weedayf.JPG

The WEEKDAY function returns the day of the week as a number (1-7) based on a date field in Salesforce.

Again, we could do this with a cumbersome formula such as:

weekday.JPG

The new way is just this:

It returns the days as a number:

days.JPG

CURRENCYRATE

currencyrate.JPG

This formula returns the conversion rate for a record’s currency code.  Great if you manage sales across countries.

You need to have Currency Management activated to use this function.

So, if your default currency is USD, but the record is GBP, you can retrieve the conversion rate, display it as a formula and use it in reports.  You will need to add in the isocode and remember to put it in quotes “EUR”.

CURRENCYRATE(IsoCode)

 The value returned will be the conversion rate such as 0.5678, you can control the number of decimal places.

MFLOOR and MCEILING

We already have access to the Round function, which allows you to round up a decimal number to the number of decimals specified in the formula but, you couldn’t round up or down!  Well now you can…

MFLOOR will round down and MCEILING will round up!

mfloor.JPG
mceiling.JPG

TIME FUNCTIONS

time.JPG

TIMEVALUE

This function is similar to the DATEVALUE function but with a TIMEVALUE function.


Great for splitting the time element out for emails for Conferences, minutes etc.

 

timenow.JPG

TIMENOW()

This function returns the current moment time.

All you need is the TIMENOW() function, no additional input is required.

MILLISECOND, MINUTE, SECOND, HOUR

Probably not FUNCTIONS you would use every day.

Looks like a few people online have tried to find a use case but not had much luck.  If anyone finds a use case for any of these I’m all ears!

☏ 01494 590428 | ✉ hello@commerceworks.net