Last week I realized that SugarCRM’s awesome Sugar Logic feature, used for forcing fields to calculate a value rather then present a data-entry field, lacked a Date-Diff type of function. PHP has one, as does MySQL and T-SQL, why not Sugar Logic?
Being heavily customizable and extendible, I built one.. With this single file and a repair-and-rebuild, the function immediately became available for use with Sugar Logic formula builder. And life was good.

3 Comments
Only for Pro/Ent/Ultimate versions
And Corp
but obviously not for Community Edition, as Sugar Logic is not inclued with CE.
To accomplish something like this in CE, you’d probably want to remove the field from the Edit View and use a standard logic hook, then use similar code as above. It’s actually easier, because you only have to do it in PHP, not PHP + JS to appease the UI.