Update other table when editing table #6847
Closed
elenaaralla
started this conversation in
General
Replies: 1 comment 1 reply
-
pls try in abcSaveHandler: protected override void AfterSave()
{
base.AfterSave();
if (IsCreate)
{
if (Connection.Exists<UserRow>(
UserRow.Fields.Username == Row.Email |
UserRow.Fields.Email == Row.Email))
{
throw new ValidationError("EmailInUse", Texts.Validation.EmailInUse.ToString(Localizer));
}
string password = "deffault_password";
string salt = null;
var hash = UserHelper.GenerateHash(password, ref salt);
Connection.Insert(new UserRow
{
Username = Row.Email,
Source = "site",
DisplayName = Row.FirstName + " " + Row.LastName,
Email = Row.Email,
PasswordHash = hash,
PasswordSalt = salt,
IsActive = 1,
InsertDate = DateTime.Now,
InsertUserId = 1,
LastDirectoryUpdate = DateTime.Now,
CompanyId = Row.CompanyId
});
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to add a user when create a customer; I used lookup editor to open user dialog (1) and when save user, it is correctly selected to customer form (2)
What I need now is to save field CustomerId on UserTable after saved the customer itself, i.e.:
How can do this?
Is there an example or documentation on how to do it?
Thank you,
Elena.
Beta Was this translation helpful? Give feedback.
All reactions