Solved

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

Posted on 2010-11-18
8
973 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Changing over from Lotus Approach v3 to MS Access 4 414
Lotus notes VB code 4 208
IBM SAN DS 3512 Controllers Networking issues 11 48
IBM Lotus notes 9 91
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

805 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