Update the formula json file by deploying modified formulas

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1778

    #1

    Update the formula json file by deploying modified formulas

    Hello, I try to achieve the following. I have an app, that is used by different users (the app itself, not inside the app). Every of my clients, who uses the app, may have slightly different formulas.
    I develop the app and the updates on a developer version of the app and on update I synchronize the custom files and folders to the client`s apps..
    As every user has a different set of formulas, I cannot synchronize the formula folder, as this would destroy the individual configuration of every user.
    Is there a possibillity to only deploy the common formulas, which are equal in all installations and protect the individual formulas?

    Like: I set all new and common formulas on my side and the formula.json file of the specified entity will be updated.
  • Kharg
    Senior Member
    • Jun 2021
    • 476

    #2
    What about developing a custom formula function that returns the site url or the app name and add the formulas in a code block?

    PHP Code:
    myFormula ifThen(
        
    ext\siteUrl() == 'mycrm.com',
        
    datetime\today()
    ); 
    I know this does not fully solve your issue but it's a no brainer workaround.

    Else you would have to add the formulas to an extension and instead of synchronizing you could install the extension.

    Sorry I do not have any better idea
    Last edited by Kharg; Yesterday, 07:12 PM.

    Comment

    • yuri
      EspoCRM product developer
      • Mar 2014
      • 9503

      #3
      There's no such an ability.

      It's possible to use a Common before-save hook that will run a formula script. The formula script can be stored in some file. It would be a non-UI feature though.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      Working...