Solved

Formula Agent

Posted on 2007-03-19
5
260 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

Technology Partners: 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
Find and delete local contacts in names.nsf 5 206
Domino Server 11 79
IBM Domino web server 5 75
Lotus Same Time 8.5 not able to connect to LDAP after AD changes 8 27
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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