Solved

LOTUS NOTES - FORMULA FOR VIEW

Posted on 2007-03-22
17
381 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
An article on effective troubleshooting
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

808 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