one to many, update fileds from many side

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zerosix
    Member
    • Jan 2024
    • 45

    one to many, update fileds from many side

    i have 2 entities A and B, one (A) to many (B) , form the B side (in formula i can get A attributes, but i can not update them), HELP
  • victor
    Active Community Member
    • Aug 2022
    • 727

    #2
    In your case will work record\update: https://docs.espocrm.com/administrat.../#recordupdate.

    For example, a One-to-Many relationship is established between entity Case and entity Account. We want to put value of the description field from entity Case into the description field of entity Account.

    In Administration > Entity Manager > Case > Before Save Custom Script > Formula insert the formula:
    PHP Code:
    record\update('Account', accountId, 'description', description); 
    

    Click image for larger version  Name:	image.png Views:	0 Size:	13.0 KB ID:	103212
    Last edited by victor; 02-29-2024, 11:28 AM.

    Comment


    • zerosix
      zerosix commented
      Editing a comment
      Thank you victor, yes it works this way,
      Account.description=description; way is not working
Working...