Order of Operations

Posted on 2006-06-01
Last Modified: 2013-12-18
Someone please look at the code below and tell me how I can adjust it so that the agent "Checkduplot" runs before the rest of the code is executed.  Thanks.

@If(@IsDocBeingEdited ; ""; @Do(@Command([EditDocument])));

FIELD createdby := @Name([CN];@Author);
FIELD createdby_1 := @Name([CN];@Author);

FIELD batch := @UpperCase(@Prompt([OKCANCELEDIT];"Enter the Batch/ Lot Number";"Enter BATCH/ LOT NUMBER now.";""));
FIELD prodnum := @UpperCase(@Prompt([OKCANCELEDIT];"Enter the Product Number/ IPL Code";"Enter PRODUCT/ IPL NUMBER now.";""));
FIELD startdate := @If(startdate = "";@Prompt([OKCANCELEDIT];"Enter the Batch Card Start Date";"Enter BATCH CARD START DATE now using the below format.                                                   xx/xx/xxxx";"");startdate);

FIELD prodname :=@If(prodnum = "";"";@SetField("prodname";@DbLookup( "" : "NoCache" ;"85256AF1:00576E26";"Dup View" ; prodnum ;4 )));

@If(prodname = "";@Do(@Prompt([OK];"Check Product Number";"Product Number/ IPL Code not in master list.  Please type in the Product Name as it appears on the Batch Card.");@Command([EditGotoField] ; "prodname" ));"");
@If(prodname = "**DELETED**";@Do(@Prompt([OK];"Check Batch Card";"Product Number/ IPL Code has been deleted.  Please type in the Product Name as it appears on the Batch Card.");@SetField("prodtext";"show");@SetField("prodname_1";""));"");

FIELD bstatus := "Product Filled";
FIELD prodtext := "show";
FIELD card := "show";
FIELD button := "show";
FIELD bodycount := 1;

Question by:schmad01
    LVL 22

    Expert Comment

    Hi schmad01,
    If you're using version 6 or later, instead of

    use @Function
        @Command( [RunAgent] ; agent )

    and it'll be executed where it's put in the code.

    Hope this helps,

    Author Comment

    No, at this time we are running 5.0.11.
    LVL 18

    Accepted Solution

    Well, I assume that  you want to check for a value, and if found, then don't execute the rest of the code?

    If so, then is @Command([ToolsRunMacro];"Checkduplot") << written in LS or Formula?

    IF formula, then you have to figure a way to pass a value from that agent to your current one.

    At top of your code:

    Best is to clear an environment value:

    @SetEnvironment( "checkdup";"");
    Rem "then call your second agent";


    >>Checkduplot : This agent needs to write an "FAIL"  or "SUCCESS" to the checkdup environment if it finds a duplicate, etc.<<

    REm "Then when that agent ends, it will roll back to the calling agent."

    @if(@Environment("CheckDup") = "FAIL"; @Return("");"");

    Now you can continue with the rest of your code.

    Author Comment

    Beautiful, thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now