Solved

Blank, Text, and Date in one column in Lotus Notes View

Posted on 2010-11-18
8
961 Views
Last Modified: 2013-12-18
This question is related to this question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_26551298.html

My question can be seen on the link above (the 4th post before the last). The users now want the ability to have a blank, 'PA', and date approved in one column in a view and it has to be sorted correctly.

What is the possible solution for this?
0
Comment
Question by:coronoahcoro
  • 4
  • 4
8 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
And here's a copy of my latest remark:

There are 2 ways you can sort that column:
1. convert date values to a YYYYMMDD string, like "20101118"
2. leave the date value, and add a to the left of it, with a string value like "    20101118" (the additional spaces serve to hide the value; the column should be fixed-width, 1 character)
0
 
LVL 2

Author Comment

by:coronoahcoro
Comment Utility
I am really confused about your solution # 2.

Your #1 solution makes sense but now how do I let the users to be able to put pending approval or even to leave it blank. I have a CustomerApprovalDate field which is a date field. I can have a text field to convert that date to text but then the users need to be able to change that to PA or blank.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Darn!! I word got removed, so sorry!!

2. leave the date value, and add a column to the left of it, with a string value like "    20101118" (the additional spaces serve to hide the value; the column should be fixed-width, 1 character)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Not "I word", but A word... sheesh what's wrong with ma keyboard...  ;-))
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 2

Author Comment

by:coronoahcoro
Comment Utility
hahah keyboard is always wrong.

Anyway after trying different things, I ended up using LotusScript and Form event. I was hoping to just use formula language. But sjef I really want to try your method but I still don't understand your suggestion. If I understand correctly, then this is what you suggested:
1. Leave the date value in the form and view
2. Add a column to the left of that date column in the view, fixed width, 1 character.
3. Now I'm lost on this part: " ... with a string value like "    20101118" (the additional spaces serve to hide the value ... " How do I add the additional spaces? If the spaces are to hide the value, what does it has to do with sorting the value (the date in string, the "PA" text, and blank).

I know you've explained it in a layman term but I just don't get it. Care to explain it further?

Anyway here is the code that I use:

 
Sub Querysave(Source As Notesuidocument, Continue As Variant)
  Dim doc As NotesDocument
  Set doc = source.Document
  Dim item As NotesItem
  Dim appvDate As String
  Dim pa As String
	
  ' Get approval date value
  Set item = doc.GetFirstItem("FRP_CustomerApprovalDate")
  appvDate = item.Text
	
  ' Get pending approval value
  Set item = doc.GetFirstItem("FRP_PendingApproval")
  pa = item.Text
	
  If(appvDate <> "") Then
    doc.FRP_CustomerApprovalDateText = Right$(appvDate,4) & "/"   & Left$(appvDate,2) & "/" & Mid$(appvDate,4,2)
  Elseif (pa = "1") Then
    doc.FRP_CustomerApprovalDateText = "PA"
  Else
    doc.FRP_CustomerApprovalDateText =""
  End If
End Sub

Open in new window

0
 
LVL 2

Author Comment

by:coronoahcoro
Comment Utility
I just changed the code again...I just remember that if the user choose 'Pending Approval', the code needs to wipe out what's in Date Approved field.
 
If(appvDate <> "" & pa <> "1") Then
		doc.FRP_CustomerApprovalDateText = Right$(appvDate,4) & "/" & Left$(appvDate,2) & "/" & Mid$(appvDate,4,2)
Elseif (pa = "1") Then
	doc.FRP_CustomerApprovalDateText = "PA"
		doc.FRP_CustomerApprovalDate = ""
Else
	doc.FRP_CustomerApprovalDateText =""
End If

Open in new window


I changed the forms to accommodate this change
PA
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
Comment Utility
One remark first: the ampersand (&) is NOT the logical 'and' in LotusScript. You have to use the word 'and'. An example:
      If appvDate <> "" And pa <> "1" Then

The additional text field you can do without. I'd suggest you make the new column also based on the field FRP_CustomerApprovalDate, but with a formula instead of only the field. The formula could be like this:

d:= FRP_CustomerApprovalDate;
@If(d=""; ""; "    " + @Text(@Year(d)*10000 + @Month(d)*100 + @Day(d)))

Make that column sortable on demand, width 1 character, fixed size, so there appears a small caret in the column header but the width of that column cannot be changed.

The formula in the original view column:
@If(FRP_CustomerApprovalDate=""; "PA"; FRP_CustomerApprovalDate)
0
 
LVL 2

Author Comment

by:coronoahcoro
Comment Utility
sjef thanks for pointing out the mistake on the code. I haven't gotten a chance to try your other solution. another problem came up. here is the link to the question: http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_26644876.html
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now