?
Solved

Formula Agent

Posted on 2007-03-19
5
Medium Priority
?
267 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 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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