Setting attribute values before object creation?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Setting attribute values before object creation?

Post by tkilshaw »

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
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

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.
Aware IM Support Team
Post Reply