Tip

Dealing 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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

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.