• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Next Number / UKID by Document ID

Hi JDEListers,

Is there a way that I can set up Next Number / UKID by Document ID, example :
Document ID Next Number / UKID
10000001 1
10000001 2
10000001 3
10000002 1
10000003 1

I know this looks like a problem which Line Number can solve, but as this record will be insert into the customized table via an interactive application.
So if 2 users using the application at the same time and click save simultaneously, this might cause the Document ID and Line Number duplicate and causing one of them is unable to be insert into the table, hence, i will like to add a Next Number / UKID as the Line Number instead of using Line Number.
 

clmates

Reputable Poster
Hi

To avoid that you must use record reservation

when the first user enters the record you check table F00095, to see if the record is locked by another user, if not, then you insert a record in F00095 and lock the record for this user

when the user exits the application you free the reservation

Regards
 

johndanter

Legendary Poster
Look at BSFN X00022 Get Next Unique ID.

That writes records to a table called F00022 (not F0002) Each time you call that BSFN it writes +1 to the value in UKID.
So I guess you could use that with your DOCO as the object name....?

Make sure you then go off and delete them from that table though as I suspect you'll be adding loads of entries :)

If you then need to add more lines tot he same order, just add a record to that table for the last LNID/UKID and start again.
 

coolkl

Active Member
Look at BSFN X00022 Get Next Unique ID.

That writes records to a table called F00022 (not F0002) Each time you call that BSFN it writes +1 to the value in UKID.
So I guess you could use that with your DOCO as the object name....?

Make sure you then go off and delete them from that table though as I suspect you'll be adding loads of entries :)

If you then need to add more lines tot he same order, just add a record to that table for the last LNID/UKID and start again.
Thanks this was helpful to me.
 
Top