Formula on a linked entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbrands
    Junior Member
    • Feb 2018
    • 23

    Formula on a linked entity

    Hi everyone,

    I started recently with EspoCRM and am still learning on how certain things work. One function is pretty much still a mystery, thats formula.
    I found out i can calculate from fields within the same entity, like fieldA = fieldB + filedC, but i was wondering if i can do the same trick with linked entities.

    Lets say i have entity "projects" and entity "expenses", i linked them together so i can add "expenserecords" to the project
    Can i make a field and let it add up the expenses by formula so it shows how much (in money) expenses are linked to the project?

    To add to that, can i also make it that it only adds the ones that have the field "approved" set to "yes"?

    Any help is much appreciated.

    Best regards,
    Maarten
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello,

    it's possible with workflow, but could work with some mistakes.
    But for now it is reliably only with hooks.
    https://www.espocrm.com/documentatio...lopment/hooks/

    Or you can create notStorable field, like Entry Count in Target List (
    application/Espo/Modules/Crm/Resources/metadata/entityDefs/TargetList.json (fields -> entryCount)
    application/Espo/Modules/Crm/Services/TargetList.php (loadEntryCountField in loadAdditionalFields and loadAdditionalFieldsForList)
    )
    Last edited by tanya; 02-15-2018, 11:17 AM.

    Comment

    Working...