Where to best put the logic for calculated, not-storable fields?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • yuri
    replied
    Hi,

    loaderClassName in entityDefs > fields > {field} can also be used. https://docs.espocrm.com/development...oaderclassname

    Leave a comment:


  • emillod
    replied
    Hello ingo
    you're doing probably something wrong, because we have a lot of notStorable fields, and they're working normally on all PDF's. I'm adding for example {{delayedInvoicesAmount}} to PDF template and tada

    Leave a comment:


  • Where to best put the logic for calculated, not-storable fields?

    Hi all,
    I am working on an extension for the management of courses (e.g. for a gym).
    There are several custom entities, one of them is CourseManagerCourse another is CourseManagerRegistration.
    The second has a belongsTo link to the first.
    I have a not-storable, read-only field in CourseManagerRegistration which calculates a registration code. At the moment, I implemented it as a Espo\Core\FieldProcessing\Loader (registered in recordDefs as listLoader and readLoader).
    Everything works well so far except in PDF templates. There, the fields are not populated when the registrations are loaded from inside a Course.
    And here comes my question: As I see it, the population of the field could also be implemented by extending the Entity class and override the get method. Or I could use the pdfDefs and implement a PdfDataLoader. Perhaps Hooks would also be an option?
    What is the best way to go here?
    Thanks in advance for your answers :-)
    Ingo
Working...