SugarLogic Custom Function subDate()

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.

This entry was posted in SugarCRM. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.


  1. agcopley
    Posted December 14, 2012 at 7:27 am | Permalink

    Only for Pro/Ent/Ultimate versions

    • Matthew Poer
      Posted December 14, 2012 at 8:12 am | Permalink

      And Corp :) but obviously not for Community Edition, as Sugar Logic is not inclued with CE.

    • Matthew Poer
      Posted December 14, 2012 at 8:13 am | Permalink

      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.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Sage President\

Profiling Solutions, Inc
174 Carroll Street
Atlanta, GA 30312
Sales: 1 (866) 515-9959
Office Phone: (404) 525-8003
Office Fax: (404) 525-8005