Video tutorial about auto-incremented attributes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
aware_support
Posts: 7173
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Video tutorial about auto-incremented attributes

Post by aware_support »

A new video tutorial has been added to the Miscellaneous section of our video tutorials page http://www.awareim.com/video-tutorials

This tutorial explains how to work with auto-incremented attributes.

Note, that the tutorial is based on the latest build 2711
Aware IM Support Team
himanshu
Posts: 659
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Video tutorial about auto-incremented attributes

Post by himanshu »

Hi Support,

I found a issue in implementing NEXT_SEQUENCE_NMB function.
All work well as shown in the video... sequence also get incremented every time when we create new record. But problem is when user does not create record and close the form, now next time it open the object to create it shows the next sequence even thought last sequence number was never used. Every time if I just open the object in creation mode and close the form SEQUENCE keep increasing.

This will not work while generating business orders as missing sequence will create problems in auditing.
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
aware_support
Posts: 7173
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Video tutorial about auto-incremented attributes

Post by aware_support »

You need to assign the return of the NEXT_SEQUENCE_NMB function to the auto-incremented attribute as specified in the video and in the doco.

If you don't, then the number will be auto-incremented twice - once by the function and the second time when the object is saved (because it will not have the value for the auto-incremented attribute). If you do assign the value, then it won't be incremented again when the object is saved (since the attribute already has the value)
Aware IM Support Team
himanshu
Posts: 659
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Video tutorial about auto-incremented attributes

Post by himanshu »

You need to assign the return of the NEXT_SEQUENCE_NMB function to the auto-incremented attribute as specified in the video and in the doco.
I completely agree with you and doing the same... I am assigning the value to attribute and using accordingly. But my point is different .. let me explain in steps

Sales Object
having following attributes
- SalesSeqNo - hold sequence number
- SalesOrderNo - hold custom order number which is a plain text

1. Create Object Sales
2. Sales Object form appear with proper values initialized "SalesOrderNo: SO_0001"
3. User change mind and do nothing just cancel/close the form
4. Next time if I again open the form I found SalesOrderNo has been increased. "SO_0002".. here is the problem SO_0001 was never created.

If we just keep opening the create form and close without creating it keeps changing the sequence number.
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
aware_support
Posts: 7173
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Video tutorial about auto-incremented attributes

Post by aware_support »

Yes, that's how it works - once the value has been incremented it cannot be decremented back.
Aware IM Support Team
himanshu
Posts: 659
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Video tutorial about auto-incremented attributes

Post by himanshu »

Hi Support,

I have prepared a short video to explain exactly what I am trying to achieve. Please correct me if I am wrong.

Have a look!
https://youtu.be/5Hju1e8FczA

Thanks
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
aware_support
Posts: 7173
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Video tutorial about auto-incremented attributes

Post by aware_support »

About the first problem. Yes, I understand what you are trying to do, but with this approach gaps in sequence are inevitable. It's the same as if the user deleted a particular record. If you really really want to avoid gaps - don't show the auto-incremented number on a form of the new object.

The second problem - check out the rule log. Somehow NEXT_SEQUENCE_NMB is executed and the value of auto-incremented attribute is still undefined (maybe it is reset to UNDEFINED by the rules after it has been assigned). If the rule log does not reveal anything please send us the BSV for investigation.
Aware IM Support Team
Post Reply