?
Solved

Formula Help - Struggling with conditions

Posted on 2006-03-29
6
Medium Priority
?
233 Views
Last Modified: 2013-12-18
I have the following formula actioned by a button on a form:

@If( Fitters_Comments != "";
     @Do(   FIELD WIP_Date := @Now;
      FIELD WIP_Fitter := @Name([CN]; @UserName);
                FIELD status := "Pending";
      FIELD Fitters_Comments_1 := Fitters_Comments_1 + WIP_Fitter + " @ " + @Text(WIP_Date) + " - " + Fitters_Comments + @NewLine ;
      FIELD Fitters_Comments :="";
      @Command( [RefreshHideFormulas] ));

     @Do(@Command([EditGotoField]; "Fitters_Comments" );
             @Command([EditSelectAll]);
             @Prompt( [Ok]; "Not Updated"; "Please enter a valid comment and try again" ) ) )

I need to add the following conditions to it:

If the status field = "Awaiting Parts" when the button is pressed I need a message box to pop up to check whether parts are still on order. If yes is pressed I want the status field to remain as "Awaiting Parts" If no is pressed I want the status field to change to "Pending"

I figure I need to take out the 4th line: FIELD status := "Pending";
and somewhere put in a @Dowhile "status =....@prompt.....@success;@failure?

I can't seem to figure this out... I bet I kick myself when I see the answer!

Thanks for your help!
0
Comment
Question by:shuboarder
  • 3
  • 3
6 Comments
 
LVL 22

Expert Comment

by:mbonaci
ID: 16321443
Hi shuboarder,
use @SetField function, FIELD works only if it's the first statement in line (not in Do, If, While block)

Hope this helps,
Marko
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16321488
mbonaci - Thanks for the quick reply!

I tried using @setfield but I kept getting an error message about passing arguments to @functions or something.

Any ideas on how it should look?


0
 
LVL 22

Accepted Solution

by:
mbonaci earned 2000 total points
ID: 16321559
shuboarder,

@If( status = "Awaiting Parts";
    @Do(
        @If( 0 = @Prompt([YESNO]; "Check parts?"; "Are parts still on order");
            @SetField( "Status"; "Pending" );
            @Return("") )
        );
    @Return("") )


Hope this helps,
Marko
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Author Comment

by:shuboarder
ID: 16321735
Ok, that's great. However now if the status isn't "Awaiting Parts" it doesn't change to "Pending"
i.e. If the status is "Active" and the button is pressed I still need status to change to pending. (just don't need a prompt to confirm.

Does that make sense?

This is the code so far:

@If( Fitters_Comments != "";
     @Do(   FIELD WIP_Date := @Now;
      FIELD WIP_Fitter := @Name([CN]; @UserName);
      FIELD Fitters_Comments_1 := Fitters_Comments_1 + WIP_Fitter + " @ " + @Text(WIP_Date) + " - " + Fitters_Comments + @NewLine ;
FIELD Fitters_Comments :="";

@If( status = "Awaiting Parts";
    @Do(
        @If( 0 = @Prompt([YesNo]; "Status"; "Are parts still required to complete this job?");
            @SetField( "Status"; "Pending" );
            @Return("") )
        );
    @Return("") );

@Command( [RefreshHideFormulas] ));

     @Do(@Command([EditGotoField]; "Fitters_Comments" );
             @Command([EditSelectAll]);
             @Prompt( [Ok]; "Not Updated"; "Please enter a valid comment and try again" ) ) )
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16321773
shuboarder,
I think you could've done this yourself:

@If( status = "Awaiting Parts";
    @Do(
        @If( 0 = @Prompt([YesNo]; "Status"; "Are parts still required to complete this job?");
            @SetField( "Status"; "Pending" );
            @Return("") )
        );
    @SetField( "Status"; "Pending" ) );


You'll never learn this way...
Marko
0
 
LVL 21

Author Comment

by:shuboarder
ID: 16321805
:(

- You always say that!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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