Solved

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

Posted on 2010-11-18
8
969 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
ID: 34165878
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
ID: 34168275
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
ID: 34168548
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
ID: 34168558
Not "I word", but A word... sheesh what's wrong with ma keyboard...  ;-))
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:coronoahcoro
ID: 34175366
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
ID: 34175473
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
ID: 34179260
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
ID: 34231739
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

13 Experts available now in Live!

Get 1:1 Help Now