Save Entity for not storable fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sltctom
    Junior Member
    • Jul 2023
    • 5

    Save Entity for not storable fields

    Hello,

    I want to save my entity after set a field of my entity but this field is not storable in the entityDef because I want to put this field only in the table between the 2 entities.

    But saving doesn't work, so what should I do?

    Btw my field is in entity2's additionalColumns and is mapped in columnAttributeMap.

    Thank you for your answers.​
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi. You can create a saver class that will handle saving for your custom field. https://docs.espocrm.com/development...rclassnamelist The parameter defines a list of saver classes that processes for an entity one by one.
    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

    • Firyo
      Senior Member
      • Jun 2022
      • 134

      #3
      Hi there,

      I wanted to give additional informations about what "sltctom" asked.

      We have a manyToMany relation between 2 entities.
      We added "additionalColumns" in their relation so we could add new fields in the "middle table".

      The problem is that when we want to either ->get('myAdditionalFieldName') or ->set('myAdditionalFieldName', 'myValue') is doesn't work.
      When using ->getAttributeList() on the said entity we can't see the new fields we added into the "additionalColumns".

      Regards.

      Comment

      Working...