Announcement

Collapse
No announcement yet.

env\userAttribute Function for ManyToMany link

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

  • env\userAttribute Function for ManyToMany link

    Hi All.
    I tried to use env\userAttribute() function to filter some data in report with MultiEnum type attribute and it works good. It's great solution.
    But now i am trying to make the same with many to many related to user entity. Is there any solution to get the same as userAttribute for related entity?

  • #2
    Hi,
    No, it is not supported for the link-multiple relation.

    Comment


    • #3
      You can utilize multiple functions:

      Code:
      $userId = env\userAttribute('id');
      
      // find first related record
      $id = record\findRelatedOne('User', $id, 'yourLink', 'userName', 'asc', 'someField=', 'someValue');
      
      ifThen( // check if $id is not empty
          $id,
          $value = record\attribute('YourEntityType', $id, 'yourAttribute')
      )

      Comment


      • #4
        Originally posted by yurikuzn View Post
        You can prepaidcardstatus utilize multiple functions:

        Code:
        $userId = env\userAttribute('id');
        
        // find first related record
        $id = record\findRelatedOne('User', $id, 'yourLink', 'userName', 'asc', 'someField=', 'someValue');
        
        ifThen( // check if $id is not empty
        $id,
        $value = record\attribute('YourEntityType', $id, 'yourAttribute')
        )
        It was a great help ! Thank you very much for sharing this !

        Comment

        Working...
        X