Using a database view, the grid always works - but I’ve found that views do not transfer from one db to another - the view has to be recreated in the new database and the application has to be recreated to work with it (maybe there is something in mySQL I need to do so that it doesn’t care what database I’m using?).
So then I discovered that i can use a query in scriptcase - instead of selecting a table - to build a grid (see example below). But sometimes when I run the grid, it doesn’t work - I get an error that it cannot access the db. The next time I run it, it is fine (with no changes to the query).
I have also tried building the grid based on the table (sec_users_address) that joins the other tables (sec_users & address); the issue I run into there is that I cannot align columns or display a grid mask for the fields in the sec_users or address tables - only the fields in sec_users_address.
My thought is to build multiple demo projects (modules) and then use those to build a production project.
So my question is - how do others do it? Use a DB View or SC Query?
So my Query looks something like this (combining 3 tables; address, sec_users, and sec_users_address)
SELECT
address.loc_id,
sec_users_address.loc_id,
sec_users_address.login,
sec_users.login,
sec_users_address.user_type,
sec_users.name,
sec_users.entity_type,
sec_users.user_type,
sec_users.email,
sec_users.mobile_phone,
sec_users.active,
sec_users.last_login
FROM
sec_users_address LEFT OUTER JOIN address ON sec_users_address.loc_id = address.loc_id
LEFT OUTER JOIN sec_users ON sec_users_address.login = sec_users.login
ORDER BY
sec_users_address.user_type, sec_users_address.login
WHERE loc_id = ‘[this_loc]’