In the past I have used CreateXpdoClasses to handle custom tables, recently I have used ClassExtender to extend the user data. This has prompted the expected question from my client; could we add their company/laboratory affiliation to the user record.
Can a related custom
Company table be added to the schema created by ClassExtender or is it better to use the schema created with CreateXpdoClasses?
Give a man the answer, and he’ll only have a temporary solution. Teach him the principles that led you to that answer, and he will be able to create his own solutions in the future.
discuss.answer
If you want to add just user-related data (i.e., there is a one-to-one relationship between users and table rows), I think ClassExtender is a better option. You shouldn't need a new table, just a new column in the existing one (assuming that you've already run ClassExtender to extend modUser).
Thanks again Bob, this is a borderline case as most are one to one but in some instances there may be several analysts per company but at the moment, and unlikely to change the most is four. I don't think that this situation will overload the extended user table so I'll just add Company name and address fields.
Just for future reference and to clarify things in my mind, will ClassExtender support related tables in a many to one relationship?
Jim
Give a man the answer, and he’ll only have a temporary solution. Teach him the principles that led you to that answer, and he will be able to create his own solutions in the future.
Yes and no. You could certainly have more than one user with the same Company name and/or address field, but the userdata_id field must be unique so that each record is for a unique user and is the only record for that user.
Give a man the answer, and he’ll only have a temporary solution. Teach him the principles that led you to that answer, and he will be able to create his own solutions in the future.