If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#52390 by himanshu
Sat Dec 14, 2019 5:06 am
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.
#52391 by aware_support
Sat Dec 14, 2019 5:43 am
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)
#52393 by himanshu
Sat Dec 14, 2019 5:56 am
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.
#52413 by aware_support
Mon Dec 16, 2019 10:41 pm
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.

Who is online

Users browsing this forum: MSN [Bot] and 18 guests