Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get @Set to work in agent

Status
Not open for further replies.

michaelt47

Programmer
Feb 11, 2003
3
US
I have been trying to get the @Set function to work in a formula agent (setting a temp variable within the formula). I declare the variable first, but it still doesn't work. I am using Lotus Notes designer 5.09a. Did I miss the memo on this one?[ponder]
Thanks in advance
 
Did you set the correct execution parameters for the agent ?
Using formulas, in R5.x you have to set the agent to Run Once, otherwise the agent will not execute.
 
Actually, I call this agent with an action. Every part of the agent works correctly except the @Set for the temporary variable. What I am trying to do is set a flag to bypass the remaining @If statements. I do, however, need to run some final code. If I can't get the @Set to work, I will probably rewrite this agent in Lotus script.

@If(...code;
@Set(UserDisapproved;"1")
);
@If(
UserDisapproved="1";
@Success;
..Final code
 
Your first IF does not have an Else condition, or it has one too many brackets.

Coding in formula language is very tricky if you go beyond basic things like retrieving data for a keyword list or setting the value of a field.

In my opinion, what you are trying to do seems too complicated for a single-field formula.
I would suggest breaking it down into several Computed-For-Display fields, where the last field computes only if the condition field allows it too.
That way, instead of bothering with complicated IFs, you just use a simple check like this :

Code:
@if(condition field = FALSE;@Return("");"")

and then go on writing the rest of the code.
In this case, if the field allows the second part to execute, the @If condition will resolve to ELSE, which does nothing, which in turn goes on with the rest of the calculation, whereas if the check is TRUE (ie the field is FALSE), then the check resolves to @Return, which will end code execution immediately.

Pascal.
 
The code snippet I showed was not complete. I was trying to use a temporary variable to hold the 'flag'.

Thanks for the effort pmonett, but I ended up rewriting the agent in Lotus Script without any problems, just a little lost time. :-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top