Solved

Formula Agent

Posted on 2007-03-19
5
259 Views
Last Modified: 2013-11-17
Hi All,

I have a couple of fields called questions and questionNo in a form called Extra Questions.

The questionNo display the number of the question and the questions field displays the question. The user can create more than one questions.

However I have a large number of records with the following:

Example 1
QuestionNo      Questions
1                  How old are you?
2                  Gender
3                  Date of Birth
4                  Question

Example 2
QuestionNo      Questions
1                  Question

I would like to remove question 4 from above but leave questions 1 to 3 in example 1 but I'm not able to do this.

In example 2 I created an agent to remove the question. The agent is a simple formula agent:
Field Questions := "";
and it works great.

I'm having difficulties with removing question 4 in example 1.

Can anyone help with this problem? I'm not sure how to remove question 4 in example 1. I would like to use a formula agent because they are easy to understand.

Thanks.
0
Comment
Question by:jose11au
[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
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
madheeswar earned 500 total points
ID: 18748126
Dim session As New NotesSession
 Dim db As NotesDatabase

dim view as notesview
Dim doc As NotesDocument

 Set db = session.CurrentDatabase
 Set view= db.getview("YourViewName")
 Set doc = view.GetfirstDocument
while not doc is nothing
 If doc.HasItem( "Question4" ) Then
 Call doc.RemoveItem( "Question4" )
call doc.save(true,true)
end if
set doc=view.getnextdocument(doc)
wend
0
 

Author Comment

by:jose11au
ID: 18754280
Hi madheeswar,

Thanks for your response. The above didn't work, do you another suggestion.

Thanks for your help.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18754361
Place the code in the Agent and make it to run on all the documents in the view.

Now, from the actions menu, try to run the agent. Also, debug if it is giving any errors.
You have to give your View name and Field name in my code. if you place the code as it is, it won't work.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus notes error message 6 108
Exchange coexistence and migration from Lotus DOmino 8 237
Lotus Domino server 9 7 88
@Mailsend 3 78
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 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