Creating new Object

Contains tips for configurators working with Aware IM
Post Reply
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

Creating new Object

Post by denisv »

When you create a new object by default you get the option to 'Create'. If you are using a counter (e.g. call number) it is allocated after creation. This means you can't use the reference as the screen resets to a blank screen. Is it possible to 'Save' the entry so it is still displayed including the newly assigned counter.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Yes. You can override the default behaviour by configuring a process with 2 rules, for example:

ENTER NEW Customer
VIEW Customer

and use this process (for example, from a menu item) instead of the default Create Object operation. Rather than showing a blank form for creating another instance, the system will re-display the newly created instance showing attribute values assigned during the creation of the instance.
Aware IM Support Team
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

You can also see your call number on the new blank form if you add the following rule to your object

If YourObject IS NEW AND YourObject.AccessionNo IS UNDEFINED
Then YourObject.AccessionNo=MAX YourObject.AccessionNo+1

If you change this rule to

If YourObject IS NEW AND YourObject.AccessionNo IS UNDEFINED
Then YourObject.AccessionNo=MAX2 (MAX YourObject.AccessionNo+1, 1000)

Then you start numbering your calls from 1001, or you can make it whatever you like. I found this approach useful for generating purchase order numbers when I configured a purchasing system.
denisv
Posts: 253
Joined: Thu Jan 19, 2006 4:36 pm
Location: Ireland
Contact:

Post by denisv »

Thanks Support , thanks Greg.

Greg in your example, does this display the next value without using it until the object is fully entered and saved, and if so does it not give rise to the possibility that in the case of User 1 and User 2, if User 1 is still entering data and User 2 creates an instance of the object, User 2 will get the same value ?

(albeit the actual value asigned in each case may correct themselves when data is entered and finalised but then it would change for one of them?)
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

I can see now, after reading aware guys explanation in the other thread, that I can get two orders with the same order number. I guess that I have to either drop IS UNDEFINED condition or add a rule to recalculate the order number for new entered orders, I have a life cycle tag for orders.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

The IS NEW condition is evaluated to TRUE only when the instance is actually created and saved in the database. This safeguards against the scenario when 2 users entering data at the same time would get the same value.

By the same token, when the object form is initialised for creating a new instance, the IS NEW condition is evaluated to FALSE. Therefore, the rule's action will not be executed and no value will be assigned. This means that the user will not see the value until the instance is created.
Aware IM Support Team
Post Reply