Formula not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    Formula not working

    I have a field "activeUser", where I want to output the current user`s ID, so I used the formula

    Code:
    activeUser=env\userAttribute('id');
    But as whatever user I log in, it always outputs user ID 1 (admin)
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    I've checked it on EspoCRM v.6.1.2 and it works as expected.

    Please provide us the next info:
    1. What EspoCRM version do you use?
    2. Steps to reproduce the issue.

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1602

      #3
      Hi,

      espoCRM 6.1.3

      Steps:

      1. created a text field activeUser
      2. set formula as above to output the ID of the currently logged in user

      Result always user with ID 1 (admin), even when I log in as diferent user. The other user is present in the database with correct ID.

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        I tested it with the 'description' field which is Text type as well. In my case it works good.
        What change did you make under a regular user, that didn't trigger the formula?

        Comment

        • shalmaxb
          Senior Member
          • Mar 2015
          • 1602

          #5
          Hello,
          it won`t work. I tried again in a test environment and also in an installation that is online. It alway with whatever user outputs the admin ID.
          My regular user is a user with attribute regular and his own role. The calculation works, but it outputs the admin ID even, when I log in as that user.

          Comment

          • shalmaxb
            Senior Member
            • Mar 2015
            • 1602

            #6
            Maximus , meanwhile I solved, what I wanted in another way and don`t need the solution to this question here not more. Though I did not resolve it.

            Comment

            Working...