Dealing with status fields

This tip describe how to deal with status fields.

Have you ever had to use a hide when formula that goes something like: Status = "In Progress" | Status = "Approved" | Status = "Awaiting Approval" | Status = "Under Review"


I built an application with which we manage all our IT work. In this application a document can have any one of 14 statuses:

  • Assigned to BA
  • Pending Business Resource
  • Requirements in Progress
  • Requirements Awaiting Signoff
  • Requirements Complete
  • Estimate Pending
  • Estimate Complete
  • Development Scheduled
  • Development in Progress
  • BA Testing
  • User Test/Acceptance
  • Implementation
  • Completed
  • Cancelled

As you can see from the list of statuses they are progressive, i.e. a document moves through these statuses as the work progresses. On the form, various fields are editable only at certain statuses and computed for display at others becuase we didn't want, for example, specifications changed after estimates had been given. As you can imagine, view selection fomulas and hide when formulas on fields and action buttons started to get out of hand.

To make things worse, while we were developing and testing this application, statuses have been added and removed and yes it was also in production! A change in status resulted in over 120 changes to hide when formulas and view selection formulas!

There had to be an easier way...

This is the solution I came up with:

  1. Put the statuses in a field on a profile document, field is called kwStatus, the field is text, allow multi values, separate entries with a new line.
  2. On the form create an editable field with the following formula: @Explode(@GetProfileField("profile";"kwStatus") ; @NewLine)
  3. On the form create a computed number field called StatusNumber with the follwoing formula: @Member(kwStatus; @Explode(@GetProfileField("profile";"kwStatus");@NewLine))

What happens now is that the StatusNumber field is set to the number that corresponds to the list position of the document status in the list in the profile document. For example, Estimate Pending gives a Status Number of 6.

Hide when formulas on fields and Action buttons and view selection formulas can now be written as hide StatusNumber >6 & StatusNumber < 10

To take this further.
The first 5 Statuses:
    Assigned to BA
    Pending Business Resource
    Requirements in Progress
    Requirements Awaiting Signoff
    Requirements Complete
are all about the specifications and 
are dealt with by the Business Analysts. 
The next 4 Statuses:
    Estimate Pending
    Estimate Complete
    Development Scheduled
    Development in Progress
are all dealt with by the Developers.

This lead to the me creating 2 new fields
 on the form:
1. Field is called IsAtSpecStage, and is a 
computed number field with the formula:
 @If(StatusNumber < 6; 1;0)
2. Field is called IsAtDevStage, and is a 
computed number field with the formula:
 @If(StatusNumber > 5 & StatusNumber 
< 10 ; 1;0)

View selection formulas then become:
 Form = "Maintenance Request" & IsAtDevStage.
 This is makes the views much faster to open.

NOTE: The above tip is relevant to any keyword fields that relates some sort of
progressive order.
This was first published in January 2003

Dig deeper on Lotus Notes Domino Formula Language

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close