Differentiating variables with the same name in the function language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MatLudlam
    Senior Member
    • Aug 2016
    • 288

    Differentiating variables with the same name in the function language

    Help and advice appreciated.

    I have a new entity type called Project hung off my Opportunity entity. The relationship is such that each Opportunity can have many Projects.

    In the script language within BPM I have created a new Project entity. This works fine. What I want to do is have the Project.name attribute have a calculated value which is derived from the Opportunity.Name.

    This is what I would like to do is something like the following (but I appreciate that this will not work):

    Code:
    Project.name = string\concatenate(Opportunity.name , '-Cash-Collection');

    How do i achieve this? I am sure that there is a function but I am not sure which one.

    Thanks in advance.
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi,
    Please use 'name' instead of 'Project.name'. Could you provide screenshots with your BPM logic and configs? Perhaps for achieving your purposes, you need something from this scope https://github.com/espocrm/documenta...mula-functions.

    Comment

    • MatLudlam
      Senior Member
      • Aug 2016
      • 288

      #3
      Thanks for the help, I now have this working. I had tried using
      Code:
      entity\attribute('name')
      which is described as "An ATTRIBUTE value of a target record." but this seemed to be the wrong target (it was the newly created record not the BPM Target record.

      I now have the code below which works perfectly; thanks for the help.

      Click image for larger version

Name:	Task Definition.png
Views:	111
Size:	37.1 KB
ID:	56126

      Comment

      • Mar555y
        Junior Member
        • Mar 2020
        • 1

        #4
        Originally posted by MatLudlam
        Thanks for the help, I now have this working. I had tried using
        Code:
        entity\attribute('name')
        which is described as "An ATTRIBUTE value of a target record." but this seemed to be the wrong target (it was the newly created record not the BPM Target record.

        I now have the code below which works perfectly; thanks for the help.

        Click image for larger version

Name:	Task Definition.png
Views:	111
Size:	37.1 KB
ID:	56126
        This looks complicated than i thought please let me know any simple version.

        Comment

        Working...