Default Team

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ednt
    Member
    • May 2022
    • 31

    Default Team

    I have a new Entity "TestDB" definied.

    I have a user with a default team and team set as Test-Team.

    If this user create a record in TestDB the Team is not set for this reccord.

    What i have done wrong ?
  • alexisc
    Senior Member
    • Aug 2019
    • 135

    #2
    I have the same thing, on manually created entities - "Event" type, " Team" is not set when creating new
    reproduced on demo, it doesn't work
    Version 7.3.3
    Last edited by alexisc; 03-08-2023, 09:13 AM.

    Comment

    • alexisc
      Senior Member
      • Aug 2019
      • 135

      #3
      for new "Entity", the "Team" is not set by default, please write how to solve this problem

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 729

        #4
        Until EspoCRM 7.4 is released, there is a workaround for custom entities in EspoCRM 7.3:

        For User who created a record:
        Code:
        $defaultTeamId = env\userAttribute('defaultTeamId');
        ifThen(
        entity\isNew(),
        entity\addLinkMultipleId('teams', $defaultTeamId)
        );
        For Assigned User:
        Code:
        $defaultTeamId = env\userAttribute('defaultTeamId');
        ifThen(
        entity\isNew(),
        entity\addLinkMultipleId('teams', assignedUser.defaultTeamId)
        );
        ​​
        Code must be inserted into each required custom entity in:Administration -> Entity Manager -> Custom_Entity_Name -> Formula
        Last edited by victor; 03-08-2023, 11:09 AM.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8453

          #5
          > Until EspoCRM 7.4 is released,

          It's not correct.

          EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.


          Click image for larger version

Name:	image.png
Views:	140
Size:	9.7 KB
ID:	88987
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • alexisc
            Senior Member
            • Aug 2019
            • 135

            #6
            Thank you! you are best!

            Comment

            Working...