Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating Agents

Posted on 2004-04-29
26
Medium Priority
?
228 Views
Last Modified: 2013-12-18
I created an agent that is suppose to run everyday to check on a field in all my documents.  I want it to change the value of NEW in my status field to OLD if the date today is greater than the date receive field in my form.  No errors appeared but it does not update my status field?
0
Comment
Question by:emem
  • 13
  • 10
26 Comments
 

Author Comment

by:emem
ID: 10946878
btw here is my formula in the agent I created

SELECT @All;
@If (stat ="New PDC" & @Today>dtercv);stat = "Outstanding PDC";stat
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10946960
use this:

FIELD stat:=stat;
FIELD dtercv:=dtercv;
@If(stat="New PDC" & @Today>dtercv; @SetField("stat";"Outstanding PDC";stat)


or else,
create a view and the selction formula for that view will be

SELECT Form="UrFormName" & (@today>dtercv) & (stat="New PDC)

Now create an agent and Run on all documents in the view and optin is the above view name

And formula is

FIEDL stat:="Outstanding PDC";
""
0
 

Author Comment

by:emem
ID: 10947167
too many arguements for @function is the 1st formula you gave me
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 19

Expert Comment

by:madheeswar
ID: 10947179
change it to
:
FIELD stat:=stat;
FIELD dtercv:=dtercv;
@If(stat="New PDC" & (@Today>dtercv); @SetField("stat";"Outstanding PDC");stat)

0
 

Author Comment

by:emem
ID: 10947246
i'll test it ....thanks again madheeswar ...you never quit on helping me =)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10951818
Or, simpler...

SELECT stat ="New PDC" & @Today>dtercv;
FIELD stat := "Outstanding PDC";

Two lines are better than four :)
0
 

Author Comment

by:emem
ID: 10955233
how come the agent does not run on the schedule I stated I want it to run every day but it does not work unless that I run it manually how is this so? I cannot view the results
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10955966
Two line is better.

and agent not running, u should be selecting to schedule daily and run on all documents in the view.

tell ur config of agent(selection , when this agent should run, etc.,,)
0
 

Author Comment

by:emem
ID: 10956202
yah may config is as follows:

Agent Name : Check Status
When should this agent run on Local? On Schedule daily starting 1:00AM
Which documents shoult it act on?
All documents in the database

and I have the formula you gave me ....and it is checked in the agents option....do i need to include anything for it to run?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956217
select the agent and from menu. Agent->Log

it should display when it has been run.
Inorder to test it again, change the time 1Am to another time which is convenient for you and test.

Don't touch the agent again untill it finished its schedule.

And u can use Qwaletee Solution which is simple and have the same result.

0
 

Author Comment

by:emem
ID: 10956374
i'll try this again hope it works i'll change the time
0
 

Author Comment

by:emem
ID: 10956621
it still did not run ...it only applied the changes when I click on it to run ....
0
 

Author Comment

by:emem
ID: 10956641
it does not function automatically
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956679
What is ur Agent log says?

Did it run?

create a view and the selction formula for that view will be

SELECT Form="UrFormName" & (@today>dtercv) & (stat="New PDC)
the above solution should display some documents. Is the documents are there?
0
 

Author Comment

by:emem
ID: 10956700
the agent has never been runned......ill try to do the view
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956728
the agent is not running on schedule.  But when the agent runs manually will the fields status changes the value?

I think it is with config of server.
0
 

Author Comment

by:emem
ID: 10956781
the view now displays the records with dtercv<@today and stat = "New PDC".... I created an agent that will replace the value of stat what shld be the config?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10957042
in the server configuratoin document in names.nsf on server, ur name should be listed to run restricted Lotus script.

else, sign the application with admin id and schedule it.

did u added ur search?
there is a button in the agent. click on Add search and selct folders from the menu.

and add the view on which it should run.
0
 

Author Comment

by:emem
ID: 10957599
ill try your suggestion i hope this particular agent would work
0
 

Author Comment

by:emem
ID: 10982918
madheeswar hello ...is there another solution to run this agent? is it possible that once I open the database a screen or message would prompt the user that the agent needs to be run for updates b4 they proceed with any transaction?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10983706
Or with the same setup, create a Lotus Script agent.

Please increase the points, as I need to write script for it.
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 200 total points
ID: 10983721
I believe u will increase points and I am giving my code:

place this into an agent.
Note: replace the view name.




Sub Initialize
      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("UrViewname")  'here replace ur view name.
      Set doc=view.getfirstdocument
      
      While Not doc Is Nothing
            doc.stat="Outstanding PDC"
            Call doc.save(True,True)
            Set doc=view.getnextdocument(doc)
      Wend
End Sub
0
 

Author Comment

by:emem
ID: 10984029
madheeswar will this code run automatically? I will place this code in an agent and run it on a schedule daily.....
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11002496
Is this working or not?
if it is working, then close this quesoitn with grade A and increase points.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
  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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

971 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