Home > Domino Tips > Administrator > Web > Serial Numbering of Web Forms
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEB

Serial Numbering of Web Forms


Merrill Callaway
02.26.2001
Rating: -2.75- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Creating serialized forms for Web applications in Notes is a simple three step process. The requirements are for a form showing the next number unless the form was previously saved, in which case it keeps the serial number it was assigned originally.

Create the Form, View, and Agent below. The computed field called "reqid" holds the serial number. The serial number is not changed if the form is edited. Only new submittals get the next serial number. You may choose to start with 1 or you may start with a larger initial number as shown: 1000. The first record will get 1000, the next 1001, ... etc.

There are two fields on the form: a computed for display (reqid_1) field will show up only when the document is "new", displaying the "next" serial number. If you don't save the document that serial number is not used.

If you edit a previously saved document, the computed field (reqid) will show up.

If there are several people using the form, the first person to save their document will get the next number, so the computed for display field may not be completely accurate in a busy environment.

You may wish to simplify by eliminating the reqid_1 field and both "hide if" formulas. Then the serial field (reqid) will simply be blank until you save the document to "set" its serial number.



Code

1. Form (2 fields and an agent):
Computed Field: reqid
Type: numeric, 0 digits after decimal
Hidden if: @IsNewDoc (optional see text above)

Computed for Display field: reqid_1 (field is optional; see text above)
Type: numeric, 0 digits after decimal
Hidden if: !@IsNewDoc
Formula:

@If(reqid="";@If(@Subset(@DbColumn("":"nocache";"";"(num)";1);1)="";1000;
      @Subset(@DbColumn("":"nocache";"";"(num)";1);1)+1);reqid)

WebQuerySave Agent: 
@Command([ToolsRunMacro]; "setid")

2. View (one column)
Private View: (num)
First Column: reqid
Column data: numeric, 0 digits after decimal
Properties: Sorted, descending order

3. Shared Agent:
name: "setid"
When: Manually from Actions Menu
Which: Run once (@Commands may be used)
Agent Code:

FIELD reqid := reqid;
id := @If(reqid="";@If(@Subset(@DbColumn("":"nocache";"";"(num)";1);1)="";1000; @Subset(@DbColumn("":"nocache";"";"(num)";1);1)+1);reqid); @SetField("reqid";id)


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Web
Display SharePoint data in a Lotus Notes Web application with Ajax
Top 10 Lotus Notes/Domino administration tips of 2008
How to create a dynamic SVG graph using a Lotus Notes agent
Hosting multiple Lotus Domino servers at one IP address without a VPN
Upgrading and patching Firefox: Security considerations for administrators
Admin2005 Learning Guides
Making old, new flavors of Domino SSO work
A fun site, with serious code
Creating corporate welcome pages with Lotus Notes
Domino Web traffic analyzers

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts