• Resolved jdponce

    (@jdponce)


    Hi
    For each record for my table “Garantias” that I insert, I want to choose an user (WordPress User). The thing is that users are my customers as well and I want to enter their services and their warranty expiration date.
    I have added the field Id; however, I don’t know how to add a combobox field where I can choose the username from there. You know what I mean?

    That would be so useful for me.

    I would appreciate your help with this issue.

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi jdponce,

    I am on a holiday and have no laptop with me. I will be back on tuesday and try to answer your question asap.

    Best regards,
    Peter

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi,

    So you want to be able to add a column that gives you a list of all WordPress user names in your WordPress database? Do I understand that correctly?

    The plugin does not support that kind of functionality yet, but I see how this could help you and other plugin users as well.

    Are you using the Data Project tool? I could add a new item type. Something like “WP User List” and let the plugin generate a listbox. Keep in mind however, that you’ll get a huge list if you have a large number of users.

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Hi Peter, thanks for answer

    The thing is that I want to post information for registered users. In my website that information is related with warranties. Then, I am creating an entry form but I need to choose the user as a dropdown list. So, When users login to the website they should be able to check up their specific information.

    How can I do that?

    Thanks in advance

    David

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi David,

    Let’s check if we understand each other correctly first. You want to create a table “Garantias” containing warranties. Right?

    Q1) Are you the one who inserts the records?
    OR
    Q2) Are your registered users inserting their own records?
    Q3) How many records can a registered user have?
    Q4) Who is updating/deleting the records in table “Garantias”?

    Thanks in advance!

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Hi Peter… Good questions!

    Q1) Yes, the administrator will create warranty records, registered users won’t enter any record, they should be able to see the information only (read only)
    Q3) The number of records for each user depends of the number of services that the company has given… usually no more than 10 in a year
    Q4) Only the administrator (the owner or the manager) will be able to update or delete records for each user (customer)

    I think that this plugin is out of the box, and the possibility to link entry data with users is a must have feature, because any web app will be used by registered users. At least, I have a lot of ideas of applications. ?? In my case, we want that each customer can be able to check up when the warranties for each service will expire.

    Thanks for your valuable help

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi David,

    You can do his with the plugin! ?? I’ll try to explain this step by step.

    – First you need to create a Data Project
    – You will need to add at least two pages to your Data Project
    – One page where your administator can add, update and delete warranty records
    – Another page that allows your users to view their own warranty records

    ADMIN PAGE
    – Set the role of the administrator page to administrator
    – Add a column to your warranty table to store the WordPress username
    (wp_user_name for example)
    – Set the column data type to varchar(60)
    – Navigate to “Manage Table Options” on the Data Projects page
    – Load your warrenty table in the repository
    – Set your labels and define which columns should be shown in the list and in
    the data entry form
    – The following steps will add a listbox containing all your registered user:
    – Add a lookup column below “Manage relationships for table …”
    – Set the source column to your WordPress username column
    (previously named as wp_user_name)
    – Set the target table name to wp_users
    – Set the target table column to user_login

    USER PAGE
    – Set the role of the user page to a role that all your registered users have
    (contributor or example)
    – Set Mode to view
    – Set Allow insert? to no
    – Set Allow delete? to no
    – Set WHERE Clause to wp_user_name = $$USER$$

    Please let me know if you get this to work!

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Wow! this is an awesome support!
    Okay, I will do it just like that…

    Thanks!

    Thread Starter jdponce

    (@jdponce)

    Hey Peter, I did every single step you sent me, thanks.
    Now, how can I do in order to link each page to a WordPress Page?
    https://prnt.sc/otr6vo
    I want to publish them and then see if works.

    Thanks

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi David,

    Looks good! ?? Not sure if I understand your question correctly, but I guess you want the test if your admin and users can edit/view the data?

    First you have to set the value of all “Add To Menu” columns to “Yes”. Your screenshot shows you have already done that for your pages. You need to do that for the project as well.

    Your project will then be shown in the WordPress dashboard. This means that users need to navigate to the WordPress dashboard in order to see your Data Project pages. For admin users this is their normal way of working. For contributors this is a bit more unsual. To test if your project works, you need to login as an aministrator and add a warranty or a specific user. Then logoff and login as the user for which you just added the warrenty. Go to the WordPress dashboard and check if you can see the warranty you just added. If you see the warranty everything is fine. To be sure however, you will need to login as another contributor to make sure you’re not seeing someone else’s warranties as well.

    If you do not want contributors to access the WordPress dashboard, you can use shortcode wpdadiehard. In your case this would look like: [wpdadiehard project_id=”1″ page_id=”2″]

    I prefer using the WordPress dashboard. It’s a secure environment and contributors will get used to work with it easily. If you want to use shortcode wpdadiehard anyway, please read the documentation on it first. There are some limitations and you need to secure the page to which you add this shortcode.

    Good luck! Let me know if you need help. And please let me know if you got it to work… ??

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Hi
    I created the relationship like you told me as you can see here: https://prnt.sc/ounbss
    However, when I run the entry form, the field “usuario” which I expect to see the dropdown list is not showing: https://prnt.sc/ouncyi

    What can I do?

    Thanks in advance

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Sorry David!

    I forgot to mention you have to select the lookup column in Manage Table Options. Try this:
    – Navigate to Manage Table Options
    – Edit table Garantias
    – Below “Manage columns for data entry form for table Garantias” select user_login from the listbox
    – Save your changes and you should be fine

    Please let me know if this works..

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Hi, I am here again
    Okay, I did what you told me, I mean: I selected user_login for the field clientes as you can see here:
    https://prnt.sc/p0efna
    However, when I go to entry form, I always get a simple text box for that field, as you can see here:
    https://prnt.sc/p0egw6

    Thanks again

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Okay, I think I see what’s going wrong. Good you added the screenshots!

    Looks like you’re using the Data Projects tool to Manage Table Options the right way. For your data entry form however you’re using the Data Explorer. Is that correct? You need to use the Data Projects tool to use your table options.

    To use the column settings defined in Manage Table Options you need to create a project and a project page for table Garantias. There is a video in the online help that shows you how this works. To watch it click on help item “Data Projects – Video Tutorials” in the online help and check out the first video. If you create a project page for table Garantias your table options will be used and the listbox will be displayed.

    Hope this helps…

    Best regards,
    Peter

    Thread Starter jdponce

    (@jdponce)

    Thanks! I will check up the video and try again.
    I’ll tell you if I can soon!

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi jdponce,

    What is the status of your topic? Are you still working on it? Can I help?

    Best regards,
    Peter

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘How to add the user id to any record in a data entry screen’ is closed to new replies.