Solved

LOTUS NOTES - FORMULA FOR VIEW

Posted on 2007-03-22
17
380 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

8 Experts available now in Live!

Get 1:1 Help Now