Solved

LOTUS NOTES - FORMULA FOR VIEW

Posted on 2007-03-22
17
383 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
[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
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Determining the an SCCM package name from the Package ID
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

617 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