User ID

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

User ID

Post by denisv »

How can I allocate the User ID value of the logged in user to a business object attribute to show who 'created' or 'modified' a record.

I have a user name field and already have rules to timestamp creation and updates
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

You can do it with a rule like this:

MyObject.ModifiedUserID = LoggedInSystemUser.ID

Consider replacing the user ID attribute on the object with a reference attribute to the user object. This way you will get access to all attributes of the user object representing the user who modified the object - not just the ID. The rule would then look like this:

MyObject.ModifiedBy = LoggedInSystemUser

If you know that the modifying user will always be represented by a specific object, for example Employee, you can make the reference attribute on the object to be of type Employee and display relevant attributes like Name, Job Title, etc. The rule would then look like this:

MyObject.ModifiedBy = LoggedInEmployee
Aware IM Support Team
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

How does the system know which one LoggedInUser to select if several users are logged in the time?
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

It will be the one initiating the change for that particular object instance. The system traces all transactions to users starting the transactions.
Aware IM Support Team
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

I suspect it is rather a bug but it is related to this thread.

I need to keep track of users who create instances of some business objects. I introduced two calculated attributes CreatedBy of the type Staff, CreationDate, a timestamp and this rule to calculate them

If FundingSource IS NEW Then
FundingSource.CreatedBy=LoggedInStaff
FundingSource.CreationDate=CURRENT_TIMESTAMP

It works as intended for business objects not linked to Staff by other attributes.
In case of FundingSource, the FundingSource.PermittedUsers is a many to many attribute of Staff type. FundingSource. When record is created then CreatedBy is linked not to the LoggedInStaff but to one of the instances of PermittedUsers. By the way, the LoggedInStaff was also one of the PermittedUsers instances.
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

Post by denisv »

While the logging of the created by user and modified by user works for me, if I change the record I need the modified user to reflect this. I also have dates for created and modified.

When I create a new record, the following get updated:

Created by, Created on, Modified by, Modified on

When I modify I want Modified by, Modified on to update and I have created a rule using Account Was Changed but it does not update. I note from Library sample that when Was Changed was used, it referred to a specific attribute of a Business Object, what if I simply want to activate based on any attribute changing, is this possible ?
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

Post by denisv »

In addition to this, when I create a record and the Created by and Created on get filled automatically (calculated) I have removed all possible actions (edit, delete etc). The display is table and it takes up a lot of space even when I am only showing the Logged in User Name.

Ideally this should just be the value without the surround associated with the Table presentgation. There is the option to change to drop down which looks better but then allows the usetr change the value which they should not be able to do.

besides removing the Column heading (which still leaves the label area) cab this presentation be formatted so that just a field with the value (locked - read only) appears ?
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

> ... I have created a rule using Account Was Changed but it does not update.
Currently you have to refer to a specific attribute when using WAS CHANGED. We will be extending support for WAS CHANGED so it could be also applied to an object. It this case a change to any attribute value would mark the whole object as changed.

> Ideally this should just be the value without the surround associated with the Table presentgation.
You can add a shortcut attribute to point to the person name, for example:

Object.CreatedByName - shortcut to - Object.CreatedBy.Name

and then display the shortcut attribute on the form instead of the reference attribute. This will be shown in plain text and will be very economical from the screen real estate point of view.
Aware IM Support Team
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

Post by denisv »

Any chance the WAS CHANGED for the object independent of which attribute changes will be in V1.6 - it's important (should I wish list this)

Understand the shortcut approach for presentation but i will still need to leave the actual attribute in order to allow editing or initially adding it.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

> Any chance the WAS CHANGED for the object independent of which attribute changes will be in V1.6 - it's important (should I wish list this)
Yes, it will be in version 1.6 due out within a few weeks.

> Understand the shortcut approach for presentation but i will still need to leave the actual attribute in order to allow editing or initially adding it.
If you want a compact presentation while allowing some users to change the reference I would suggest using the dropdown presentation option. If you do not want some other users to change the reference you can set a read-only access to the attribute for the corresponding access level.

Additionally, version 1.6 will support a table-like presentation for single reference attributes without the caption and label bars, essentially compressing the table to a single line vertically.
Aware IM Support Team
Post Reply