Jump to content
  • 0

How to build a trigger Auto populate the TenantID field based on the inserted UserID field.


fergge

Question

I have a multi-tenant application that uses a Tenant Table to create a TenantID, and then a User Table to create a unique UserID.  The tables are related Tenant to Users on a One to Many.  For all other tables, when a new record is created, the UserID is captured as a foreign key and is a primary Index.  I also need the users related TenantID in each record and would like to have this field auto populated based on the UserID field that has already been entered.  

What is the best method for accomplishing this task.  I prefer to use a trigger over a formula in a datapage, as doing so in a datapage would require me to do so for every page.

image.thumb.png.e9b21b4a331fec7f894f2000bd5b02ed.png

Thanks.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...