Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-11-18
8
Medium Priority
?
1,012 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34168558
Not "I word", but A word... sheesh what's wrong with ma keyboard...  ;-))
0
 
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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

604 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