Creating agents using formulas

I would like to create an agent that will set the ExpireDate on a document 2 months from the current date. Using formula’s I can perform the date logic to get the current date and add 2 months to it. This is working fine.

What I am trying to do is then update the ExpireDate field on the document with this new date. How do I update a document field like ExpireDate within a formula? If I just reference the field and assign it the new date - it does not work.

For example:

ExpireDate := NewDate;

There must be some syntax here that I am missing? From what I can tell, the formula thinks ExpireDate is just a variable and not a field on the mail document.

Subject: Creating agents using formulas

when using a document value use the keyword field in front

field expireDate := newDate

John

Subject: Creating agents using formulas

To assign a value to a field, you need to use the FIELD keyword or the @SetField function:

FIELD ExpiredDate := NewDate