Announcement

Collapse
No announcement yet.

Formulas: Get Related Entity's Phone Number

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

  • Formulas: Get Related Entity's Phone Number

    Hi there,

    we've set up a workflow to create a Call (Related Record) whenever a new Lead (Target Entity) is created (see screenshot attached).

    The new call should have a short description, including the Lead's phone number. To achieve that, we used the following formula for the new related record:
    Code:
    short_description=string\concatenate(targetEntity\attribute('first_name'), " ", targetEntity\attribute('last_name'), " - phone number: ", targetEntity\attribute('phone_number.name'));
    Using phone_number.name was a best guess that didn't work.

    Any suggestions?

  • #2
    Hi,

    Did you try targetEntity\attribute('phoneNumber') ?

    Comment


    • #3
      Yes, I tried:
      Code:
      parent_id=targetEntity\attribute('id');
      short_description=targetEntity\attribute('phoneNumber');
      Also,
      Code:
      parent_id
      isn't working either.

      Any other ideas?

      Here's the current setup:

      Click image for larger version

Name:	espo_workflow_setup.png
Views:	295
Size:	110.9 KB
ID:	32847
      Last edited by tobias; 11-30-2017, 07:35 PM.

      Comment


      • #4
        Maybe you should try:

        parentId = targetEntity\attribute('id');
        shortDescription = targetEntity\attribute('phoneNumber');

        .

        Comment


        • #5
          Perfect, that did the trick

          Note that we as well had to set parentType = 'Lead'.

          The final code reads:

          Code:
          parentId = targetEntity\attribute('id');
          parentType = 'Lead';
          shortDescription = string\concatenate(targetEntity\attribute('firstName'), " ", targetEntity\attribute('lastName'), " - phone number: ", targetEntity\attribute('phoneNumber'));

          Comment

          Working...
          X