How to generate a seven digit Sequential Number. I can generate sequential number by making a field on the form and incrementing that field on ever Save Event. But the problem is that how to make the sequential number 7 digit … I have looked through the help and didnt find anything for making 7 digit number format … Help would be highly appreciated.
Regards,
Jawad Rana
Subject: How to generate a seven digit sequential Number ??
The NUMBER doesn’t have to be seven digit does it?Surely only the way people see it needs to be seven digit
i.e. if the docnumber is 22, then you want 0000022 to be shown in views etc.?
The solution to this is
@left (“0000000”+@text(docnumber);7)
This has the advantage of being categorisable, and dblookups will correctly find the right doc
Subject: RE: How to generate a seven digit sequential Number ??
forgive me as i am tired, but what the heck is:
@left (“0000000”+@text(docnumber);7)
going to do and where are you proposing he do this.
To pad a number:
tmpNumber:=@Length(Number);
tmpPad:=@if(tmpNumber=7;“”;tmpNumber=6;“0”;
tmpNumber=5;“00”;…etc, etc);
tmpPad+@Text(Number)
Subject: Typo, I think. Should be: @Right (“0000000” + @text (docnumber); 7)
Subject: Oopsie
You’re right, I did mean @right - I’d had a long day already by then
hcl-bot
February 21, 2005, 9:47pm
6
Subject: sequence no auto increased
But how come sometimes the sequence no increased by 1 after save the document.
Subject: How to generate a seven digit sequential Number ??
If using LotusScript
Format(1, “0000000”)
This will return ‘0000001’ as required.
–
Regards,
Anthony Lee
Subject: How to generate a seven digit sequential Number ??
i have used x :=@DbColumn(“”:“NoCache”;“”:“”;“DocNo”;1);
FIELD HDocNo :=@If(@IsError (x) | x=“” ;10001;@Subset (x ;1)+1);
in save button which is visible only in newdoc for five digit number starting from 10001 same way you can start from 1000001.
I have used a hidden view “DocNo” with only one column with field HDocNo sorted in descending order.