Link to home
Start Free TrialLog in
Avatar of kwamemiller
kwamemiller

asked on

Need help writing a simple agent

Hi, I need to write an agent to replace the values of a field AccountManager when its value is empty to become "administrator". I have written the code below but it doesn't work. Does anyone know why?
@If(AccountManager="";"administrator";AccountManager);
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sjef Bosman
Hi kwamemiller,

The formula seems OK, Do you have sufficient access to the documents? Is it a special field (Reader/Author)?

Cheers!
   Sjef
Avatar of kwamemiller
kwamemiller

ASKER

Thanks qwalatee, your code works!! Don't know why the code I wrote doesn't execute though but in the meantime, I'll be using your code. Thanks also to Sjef.
Kwame
Agents have two parts -- one part tells it which documents "qualify" (the SELECT), the rest tells the agent what to do with the qualifying document.

So, we select docs that have a blank value.

OK, now what do we do with it?  Well, we can't just write "administrator" -- we have to tell it what to DO with administrator.  So, we tell it that there is a field named AccountManager that we wish to change to this value.  (The fact that the SELECT mentioned this field means nothing, since you might want to qualify based on one field, but change a different field.)
All points to Qwaletee!