Announcement

Collapse
No announcement yet.

Obtaining the id of a created record

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

  • Obtaining the id of a created record

    Hello.

    We have recently migrated to version 6.0.8 from 5.9.1 and to version 2.6.5. of the advanced pack from version 2.5.12

    We are experiencing a difference in the way BPM operates.

    In version 5.9.1, when we generated a new record we were able to find out the ID of that new record. What we did was, once the record was generated, then we updated that record and in the update process we put: $somevariable = id; .

    We did as shown in this image. Firest we created the record (green) and then we updated it (blue)

    With that we had a variable with the value of the id.

    However, in the version 6.0.8 this is not working in the same way. The variable always appears empty.

    How can I do to get to know the id?


    Attached Files

  • #2
    Hello,
    Try to fetch `id` with this formula https://docs.espocrm.com/administrat...ntityattribute.

    Comment


    • #3
      Thank you Maximus

      I have tried what you suggested for both the record creation and the record update, as you can see highlihted in yellow in the image
      You can see, too, other, possibilities I have tried

      In neither case obtained the id
      Attached Files

      Comment


      • #4
        Got it!!

        In case someone gets the same need, this is how I solved it:

        After the creation you need to define script task, and there this is the instrion I used:

        $prIdTarea = 'y4rsmxoqmy_7z3vr7g014';
        $prALInventarioId9 = bpm\createdEntity\attribute($prIdTarea, 'id');

        That number in $prIdTarea variable is obtained in the task used to create the record. In my case was highlighted with green in the images

        Comment


        • rinorway
          rinorway commented
          Editing a comment
          Really nice seeing people sharing their solutions!
      Working...
      X