Announcement

Collapse
No announcement yet.

Creating a one to one table linked entity with users. users is one-to-one left.

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

  • Creating a one to one table linked entity with users. users is one-to-one left.

    1. export your users entity. (Note, you will have to open your espo/data/config.php file set the records per page to what ever you need. I set mine to 2600 because I had that many users. 'recordsPerPage' => 100, to 2600 or what ever you need.
    In the same file, you will also need to change this 'recordListMaxSizeLimit' => 2600 refresh and rebuild.

    2. Export the complete users table. There is a radio button that will allow you to do this when you are doing exports. Choose your entity (mine was user) and match up any fields you want to move over to the related table. Make sure you select csv in the pull-down. It will make step 3 much easier.

    3. Go to admin import and choose your target. Select the users csv export that you created in step 2. Match the name lname, fname and any other fields that you want to move over to the second table. IMPORTANT, when you choose the ID, select the userId when matching.

    For 2600 records, this import takes a while so go get a cup of coffee.

    Once the import is complete, make sure that in layout manager, you have the user field in detail view in the second table (mine is tech) and make sure that you have the tech (or what every your entity name is) field in the users table.

    Clear cache and rebuild. You should now have links in both entity's pointing to each other. This is extremely useful for using custom coding on a custom entity and I hope this helps. Let me know if you have any questions.
    Last edited by Redwood; 08-06-2020, 04:39 AM.
Working...
X