Solved

LOTUS NOTES - FORMULA FOR VIEW

Posted on 2007-03-22
17
376 Views
Last Modified: 2013-12-18
Hi,

I have a RTF field where I am able to load a photo into my form. I would like to know if it's possible to create a column under existing view to lookup if I have loaded a picture and then put an ICON in the column to show me that I have or have not loaded the picture. This way I am able to see quickly which one's I have missed and work on them only, as apposed to opening each record to see if i have loaded the picture.

The field name is called 'photo'

Thanks
0
Comment
Question by:collenr123
  • 7
  • 6
  • 2
17 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 18770126
Yes it is possible.

In the Column have the below code:
@If(@Attachments>0;52;51)

and enable Column to display icons and use the icon which u want replacing the numbers.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18770130
use this:
@If(@Attachments;52;51)
0
 

Author Comment

by:collenr123
ID: 18770148
Hi, I have used your second and first suggested solution and it now show's I have a picture uploaded to them all... not working quite right?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18770215
then all those documents would have attachments.

You do one more thing.

Use @if(@Elements(@AttachmentNames)>0;53;52)

and also save a document without attachment.
0
 

Author Comment

by:collenr123
ID: 18771322
Hi,

not quite still... you see, some records have the attachment, some not...

also, just wondering, this is not an attachment per say that I have uploaded, it's a visible picture inside the record... I used a Rich Text Field for this purpose, so it's  not quite an attachment...

Is there something that one could look at for an empty field??
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18771411
This is some what tricky.

At the time of saving the document, u need to check if there are any images embedded into RTF field. Based on that set a flag to one field and make use of that in the view column.
0
 

Author Comment

by:collenr123
ID: 18771419
Okay, so what do I need to do for that?
0
Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

 
LVL 19

Expert Comment

by:madheeswar
ID: 18771433
check this in Designer Help:
EmbeddedObjects property  
Sub Initialize
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim doc As NotesDocument
  Set db = New NotesDatabase( "SanFrancisco", "hill.nsf" )
  Set view = db.GetView( "All Documents" )
  Set doc = view.GetLastDocument
  If doc.HasEmbedded Then
    Forall o In doc.EmbeddedObjects
      Messagebox( o.Name )
    End Forall
  Else
    Messagebox "No embedded objects found"
  End If
End Sub
0
 

Author Comment

by:collenr123
ID: 18771444
where must I put that?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18771597
Take a backup of your db.
Put below code in an agent and run on all the documents in the view.
dim ss as new notessession
Dim db As NotesDatabase
  Dim view As NotesView
  Dim doc As NotesDocument
  Set db = ss.currentdatabase
  Set view = db.GetView( "All Documents" )
  Set doc = view.GetFirstDocument
while not doc is nothing
  If doc.HasEmbedded Then
    Forall o In doc.EmbeddedObjects
      Messagebox( o.Name )
doc.YourFlagField = "Yes"
call doc.save(true,true)
    End Forall
  'Else
   ' Messagebox "No embedded objects found"
  End If
set doc=view.getnextdocument(doc)
wend

Once you run the above agent, now in the column,
@If(YourFlagField="Yes";51;52)
0
 

Author Comment

by:collenr123
ID: 18771656
I just get OBJECT VARIABLE NOT SET
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18772164
try to use Lotus Script Debugger and check at what place it is giving.

And also, u should give your view name and field name aswell.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 18779910
STOP STOP STOP STOP

Madweeswar, you're still giving him code for attached pictures.  He's not doing that.  He's already said he's not doing that, he's PASTING AN IMAGE into the rich text.

Unfortunately, NotesRichTextNavigator can check for tables, docLinks and a bunch of other things, but not for embedded pictures.  There is no other built-in Notes function for parsing out rich text content, so you are sort of stuck. At that point, you either have to do some complex Notes API stuff to work this out, or you need to get the Midas toolkit for processing rich text.
0
 

Author Comment

by:collenr123
ID: 18780082
okay, I think I will make it that the lookup is hidden, unless a checkbox is ticked to unhide it, then use the check box as means to show if picture is embedded or not... how would I link a marked check box to show if it's marked or not in the view?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 200 total points
ID: 18782026
If I understand you, you want to have a checkbox that the user will manually tick to indicate a picture is present, and when deciding whether to display a picture indicator in the view, you will, instead of trying to check for an actual picture, just check for the tick mark.

Correct?

OK, not difficult.  Create a checkbox called PicturePresent.  On the second tab, enter a single available value as follows:
Picture is present | 14

ENter it exactly as above.  Now add a view column, set to formula @TextToNumber(PicturePresent), and set it show an icon.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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.
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…

705 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

18 Experts available now in Live!

Get 1:1 Help Now