Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Database Flag Primary User

    Scheduled Pinned Locked Moved Operating
    6 Posts 2 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hello,

      I'm currently searching for a flag in the DB that sets the user as primary user.
      I wrote an php script that exports the i-doit data, but i got troubles querying the primary user
      out of a device that is used from more than one user. Do you know where this flag is set in code or database?

      Greetings
      Thomas

      1 Reply Last reply Reply Quote 0
      • J Offline
        jkondek
        last edited by

        Hello Thomas,

        do you mean the category "contact assginment"?

        Regards,
        jkondek

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Hello jkondek,

          exactly what i meant.

          Greetings Thomas

          1 Reply Last reply Reply Quote 0
          • J Offline
            jkondek
            last edited by

            Hello Thomas,

            in the table "isys_catg_contact_list" there is a column named "isys_catg_contact_list__primary_contact".
            The value can be 0 (not primary) or 1 (primary).

            Check it out 😉

            Regards,
            jkondek

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              Hallo jkondek,

              thanks this helped me a lot, the only thing i'm still looking for is a database connection
              between the object ID and the name of the User  (obj_title is unfortunately inconsistent)

              Thanks a lot
              Thomas

              1 Reply Last reply Reply Quote 0
              • J Offline
                jkondek
                last edited by

                Hello Thomas,

                that's easy, here is a query for all objects with a primary contact:

                SELECT
                j1.isys_obj__title AS 'object',
                j2.isys_obj__title AS 'primary contact'

                FROM isys_obj AS j1

                LEFT JOIN isys_catg_contact_list
                ON isys_catg_contact_list__isys_obj__id = j1.isys_obj__id

                LEFT JOIN isys_connection
                ON isys_connection__id = isys_catg_contact_list__isys_connection__id

                LEFT JOIN isys_obj AS j2
                ON j2.isys_obj__id = isys_connection__isys_obj__id

                WHERE TRUE
                AND isys_catg_contact_list__primary_contact = 1

                Maybe you want to add something like this (only all server):
                AND j1.isys_obj__isys_obj_type__id = 5

                Regards,
                jkondek

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post