LOTUS NOTES - FORMULA FOR VIEW

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
collenr123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

madheeswarCommented:
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
madheeswarCommented:
use this:
@If(@Attachments;52;51)
0
collenr123Author Commented:
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
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

madheeswarCommented:
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
collenr123Author Commented:
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
madheeswarCommented:
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
collenr123Author Commented:
Okay, so what do I need to do for that?
0
madheeswarCommented:
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
collenr123Author Commented:
where must I put that?
0
madheeswarCommented:
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
collenr123Author Commented:
I just get OBJECT VARIABLE NOT SET
0
madheeswarCommented:
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
qwaleteeCommented:
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
collenr123Author Commented:
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
qwaleteeCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.