If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#437 by tkilshaw
Wed Feb 22, 2006 10:01 pm
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

#449 by aware_support2
Thu Feb 23, 2006 12:29 am
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.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 19 guests