How can I set the value of an attribute that shown on a form before the form is created?
For example, I have a reference attribute, AssignedTo, that points from Account to a list of RegularUsers. A popup menu shows the LoginNames of all RegularUsers.
When Create Object is called for a new Account, the Account form appears and it already shows a value of "sp2" in the AssignedTo attribute. That is not the LoginName of the current user. It just happens to be the last LoginName in the AssignedTo popup menu.
I know that I can set it to the current RegularUser with a rule after creation. But the user may have changed it on the form, so I could end up overwriting their setting.
thanks,
Terry
Setting attribute values before object creation?
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
Terry,
You can achieve this by adding the following rule to Account object:
If Account.AssignedTo IS UNDEFINED Then Account.AssignedTo = LoggedInRegularUser
Aware IM regards rules with such a condition as initialisation rules and executes them even before the form for the new instance is displayed to the user. This way the form is displayed with attribute values already set to the specified initial values.
On the other hand, if the user manually changes the attribute value on the form to something else, this rule will do no harm because its condition will no longer be met and therefore its action will not be executed.
You can achieve this by adding the following rule to Account object:
If Account.AssignedTo IS UNDEFINED Then Account.AssignedTo = LoggedInRegularUser
Aware IM regards rules with such a condition as initialisation rules and executes them even before the form for the new instance is displayed to the user. This way the form is displayed with attribute values already set to the specified initial values.
On the other hand, if the user manually changes the attribute value on the form to something else, this rule will do no harm because its condition will no longer be met and therefore its action will not be executed.
Aware IM Support Team