I am trying to create an agent that will allow me to set the expire date on a selected email. I would like to set the expire date to 30 days from the current date.
Any suggestions on how to do this?
I am trying to create an agent that will allow me to set the expire date on a selected email. I would like to set the expire date to 30 days from the current date.
Any suggestions on how to do this?
Subject: Seeting document expire date with an agent
Look at @Adjust
Subject: RE: Seeting document expire date with an agent
Thanks for your suggestion. The adjust function is a good idea. I think I am having a basic (probably) syntax issue with getting this to work. I have created an agent and one of its actions is:
Modify field ‘ExpireDate’: Set to ‘@Now()’ - when I execute the agent - the Expire Date filed is set to @Now not the current date. I have also tried to convert @Now() to Text using the @Text() with the same result.
Any idea what I am doing wrong? For some reason when I execute the agent I am not getting the result of the function I am calling - just the text of the function call.
Subject: RE: Seeting document expire date with an agent
It’s a good idea, when you ask a question here, to provide as much information as you can about what you’re doing and what’s not working.You’re using a “simple action” agent, but trying to mix that up with macro code. When you use the “modify field” simple action, Notes expects you to enter the new value for the field – not a formula to calculate the new value. In this case it expects a constant date value. You entered something that cannot be converted to a date, so it stored the string instead.
If you want to do calculations, it’s going to be easiest in this case to create a formula agent instead (you can do it with a simple action but it requires an extra layer and you end up writing the same formula anyway. So instead of “Simple action(s)”, select “Formula”, and enter the following formula:
FIELD ExpireDate := @Adjust(@Today; 0; 0; 30; 0; 0; 0)
Make sure the agent is set to run on “selected documents” (in the agent properties infobox) or you may be in for a rude surprise when you run it.
Subject: RE: Seeting document expire date with an agent
Thanks for your help. It solved my problem.