A unique counter is fundamentally not possible in Notes, because you cannot assume that all users see the same key table. You might initially assume that nobody uses a replica. But that can change during the lifecycle of the application.
A sequential number is impossible due to these considerations. You can cobble something together, but it remains a makeshift solution.
Solution
Create a unique, non-sequential ID. The formula below generates one from the current time. Assumption: there will never be two users creating a document in the same second. If that is too "bold", simply add a user identifier (such as the first letters of the first and last name).
Example: Unique Counter
TimeNow := @Now; YearString := @Right(@Text(@Year(TimeNow)); 2); MonthString := @Select(@Month(TimeNow); "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; "10"; "11"; "12"); DayNumber := @Day(TimeNow); DayString := @Select(DayNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(DayNumber)); HourNumber := @Hour(TimeNow); HourString := @If(HourNumber = 0; "00"; @Select(HourNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(HourNumber))); MinuteNumber := @Minute(TimeNow); MinuteString := @If(MinuteNumber = 0; "00"; @Select(MinuteNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(MinuteNumber))); SecondNumber := @Second(TimeNow); SecondString := @If(SecondNumber = 0; "00"; @Select(SecondNumber; "01"; "02"; "03"; "04"; "05"; "06"; "07"; "08"; "09"; @Text(SecondNumber))); @TextToNumber(YearString + MonthString + DayString + HourString + MinuteString + SecondString)