Announcement

Collapse
No announcement yet.

Request for new built-in field value to check for logged-in user

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

  • Request for new built-in field value to check for logged-in user

    I am re-posting this as the title in the previous was wrong and i found no way to edit it.

    Currently there are field values such as "assigned user" and "team" for testing available in various areas such as filter, conditions and formula. It will be fantastic and of great value if we could have a built-in field value in conditions and formula labelled "Loggedin" which allows us to test the logged in user, We could use this to check (for example):

    PHP Code:
    field Loggedin equals/in/not it/not equals to <usernamesin the user entity
    Use case:

    (1) we could display some fields based on a user, such as "Admin"
    (2) display a detail layout panel based on a specific user or users e.g. fields that used or updated by formula which should only be visible to Admin.​

  • #2
    I guess for formula you could use env\userAttribute('id') which give the id of the current logged in user.
    Rabii
    Web Dev | Freelancer

    Comment


    • #3
      Hi rabii


      Perhaps did not present a clearer use case.
      In the Detail Layout, We need to show the following panel if the logged-in user matches one of the registered user. I could use the formula you suggested in the Workflow or Before Save for the entity. I am unable to use the formula in conditions for the field or make the panel visible.

      Click image for larger version  Name:	Detail Panel.png Views:	0 Size:	27.4 KB ID:	108657
      Last edited by murugappan; 07-20-2024, 09:59 AM.

      Comment


      • #4
        There is already a $user in condition from version 8.2 and above. That should do the job, the $user is actually the current logged in user. see attached screenshot.
        Attached Files
        Last edited by rabii; 07-20-2024, 01:13 PM.
        Rabii
        Web Dev | Freelancer

        Comment


        • shalmaxb
          shalmaxb commented
          Editing a comment
          It is always very nice, when a user informs about modifications, which another user did not see yet. So, thank you rabii.

      • #5
        Hi rabii and shalmaxb Thank you for the Update and yes it worked. The problem is i could not get the info from the documentation (see screencap below). Well, that is why we have the forum for people to help each other. Wish i could help to update the documentation not sure how and what tool to use.

        Click image for larger version  Name:	Screenshot_3.png Views:	0 Size:	14.3 KB ID:	108664

        We should close this topic as resolved.
        Last edited by murugappan; 07-21-2024, 06:19 AM.

        Comment


        • murugappan
          murugappan commented
          Editing a comment
          shalmaxb True. The upgrades are coming very fast. Compared to other software, Espocrm is very stable and few (minor) bugs on each major release. The best CRM software we have used and never regretted it at any instance. Congrats to yuri and team!

        • rabii
          rabii commented
          Editing a comment
          No, you can still submit pr for the documentation and it will be processed by the team. There is a documentation on github that you can fork and start submitting your PRs.
          It is difficult to document every feature for the whole crm a time consuming process but as far as the current docs it covers almost everything. One thing a crm user needs to do is to read the release note which will show new features that have not been added to the docs yet.

        • murugappan
          murugappan commented
          Editing a comment
          rabii I understand the effort needed. Thank you for the update.
      Working...
      X