Solved

Formula Agent

Posted on 2007-03-19
5
250 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
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
madheeswar earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 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

14 Experts available now in Live!

Get 1:1 Help Now