How to add an attribute to user table

Hi, How could I add a new field to the user table for example an email account “password”, in order to send emails with the email and password account of the current user logged.

thank you.

Interesting question, I guess you are looking to update the native User Entity.
Not sure if this is possible, but what you can do is : create an entity (like MailAccount) with an attribute type ASSOCIATION pointing to sec$Userobject, then you can add as many columns as you want…

Regards,
Gent

Hi,

you can use entity extensions to make this happen. In the docs there is an example for the extending the user: Extending an Entity - CUBA Platform. Developer’s Manual.

Alternatively you can as Gent supposed create an Entity “Employee” e.g. that has an association to the user where you store all the stuff. For non-technical attributes it is probably better.

Bye
Mario

Hi, The second option sounds better, I am gonna try it, thank you

Regards.
Jorge Soto

Thank you Gent