RE:Como hacer consecutivos
Cristina:
el siguiente documento es para crear un consecutivo , esta en ingles, espero no tengas problemas para traducirlo:
1 - Create a form i.e. Counter, with an editable number field in it i.e. Sequential_Number
2 - Create a view i.e. Counter, specifically for the new form. Hide the view.
3 - Create a computed text field in the DB profile document to store the UNID of the Counter document. The formula for the field is as follows:-
REM "This field finds and stores the UNID of the Counter document";
View := "Counter";
Key := "Counter";
UNID := @DbLookup("Notes": "NoCache"; ""; View; Key; "Doc_ID");
@If(@IsError(UNID); "UNID not found"; UNID)
4 - In the form that requires the sequential number, create a computed when composed text field i.e. Counter_UNID with the following code:-
@GetProfileField("Setup" ; "Counter_ID")
Again in the form that requires the sequential number, write the following code in the Queryclose event of the form that requires the sequential number:-
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As Notesdocument
Dim counterdoc As Notesdocument
Dim Workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = Workspace.CurrentDocument
Set db = session.CurrentDatabase
Set doc = Source.Document
' Check to see if you are in edit mode....
If Source.EditMode Then
'Check to see if the document is new
If uidoc.IsNewDoc Then
Exit Sub
Else
If doc.Sequentia