Question

  Asked: May 16 2008   12:53 AM GMT
  Asked by: Domino Ask The Experts


Using Formula language code to generate unique reference numbers


Formula Language, Lotus Notes

I need to generate a unique reference number for every new Lotus Notes document that is captured. I want to use some Formula language code. Can anyone help me to get started?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



I use a computed text field on the form with the following code

calc := @TextToNumber(@Word
(@Implode(@Text(@DbColumn
("Notes" : "NoCache"; ""; "(DocNumber)"; 1))); " "; 1))
+ 1; @If(@IsNewDoc;@If(@IsError(calc); "0000"+"1";
@If(@Length(@Text(calc))=1;"0000"+@Text
(calc);@Length(@Text(calc))=2;"000"+
@Text(calc);@Length(@Text(calc))=3;"00"+
@Text(calc);@Text(calc))); DocNumber)

Where DocNumber is the name of the field and (DocNumber) is the name of a view created.
The view (DocNumber) must include the DocNumber field from the form only and this needs to be arranged in descending order.
Hope this helps.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Lotus Domino.

Looking for relevant Lotus Domino Whitepapers? Visit the SearchDomino.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register