Announcement

Collapse
No announcement yet.

attribute in formula

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • attribute in formula

    Hi, How can I access in formula to same attributes in different records:
    for example:
    I Have meeteing with fields
    datestart=1.1.2020
    repeat=365

    after marking in active record
    status = close
    I need create duplicate of actual record

    and set datestart(field in new) = datestart (field in old) + repeat (field in old)

    can i do it for example thru the Id of record?
    something like

    ifThen(status = 'Meeting',
    $activeid = Meetingid;
    $newid = record\create('Meeting');
    record\update('Meeting', $newid , $newid.datestart, datetime\addDays($activeid.datestart, $activeid.repeat)
    )
    etc...

    thank you

    wbr .s.

  • #2
    Hi,
    This one works good:
    Code:
    ifThen(
        entity\isAttributeChanged('status') && status == 'Held',
        record\create(
            'Meeting',
            'name', string\concatenate(name, " - duplicated"),
            'dateStart', datetime\addDays(dateStart, repeat)
        )
    );
    BTW, if you have Advanced Pack you can easily achieve the same result with Workflow https://www.espocrm.com/extensions/advanced-pack/.

    Comment


    • #3
      Hi,
      you are right, but advanced pack resp. workflow can't concentrate field + text (in name) and field + field (in datestart)
      it must be used as included formula.


      Thank You

      PS: with advanced pack is more fun

      Comment

      Working...
      X