We want to generate a default password when creating a new system user (in case no other value is provided). And then notify the new user of the login details by email, suggesting him/her to change the password on the first login.
We created a new Staff attribute "Notification" (yes/no) to control whether the user has been notified by email.
The Staff object then has the following rule>
If Staff IS NEW AND Staff.Password IS UNDEFINED Then
Staff.Password=Staff.ID
Staff.Notification='No'
The problem is that the password is receiving a "blank" value, probably because the Staff.ID is not yet available? (Staff.ID is a database generated identifier).
So we thought of using a solution similiar to the Library sample application, that is>
If Staff IS NEW AND Staff.Password IS UNDEFINED Then
Staff.Password=COUNT Staff
Staff.Notification='No'
But now the problem is that we have no more access to the password value, since it's encrypted, in order to notify the user.
What would be the best recommended solution? Is there a way of accessing the value of Staff.ID in the rule that tests the "IS NEW" condition? Or how could we access the password attribute and send it's value to the user, despite being encrypted?
Appreciate any suggestions/ideas.
Thanks