?
Solved

Save as Open, Save as Closed, and Cancel buttons...probably an easy one

Posted on 2003-12-01
15
Medium Priority
?
303 Views
Last Modified: 2013-12-18
I want to create 3 buttons on my form: Save as Open, Save as Closed, and Cancel.  Each will do the following:

Save as Open: save the current form with STATUS field indicating "Open"
Save as Closed: save the current form with STATUS field indicating "Closed"
Cancel: close the document and discarding any changes made

There are two buttons at the top of my form currently (not exactly sure how they got there, but I must have added them somehow), both are (Untitled)(Action)s.  Would love to add a third and have them do what is indicated above.

Like I said...this is probably pretty easy.  
0
Comment
Question by:brianbailey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 3
15 Comments
 
LVL 14

Expert Comment

by:p_partha
ID: 9852149


Code in the buttons:

Save as open


Field status:="Open";
@command([filesave]);


Save as closed

Field status:="Closed";
@command([filesave]);

cancel
@command([fileclosewindow])


To create this button, go to the form. IN the create menu --> action.. You can give the names and paste the formula given above


partha
0
 

Author Comment

by:brianbailey
ID: 9852407
Okay...they change the field, but the document does not close on either status changes.  The Cancel function brings up the dialog as to whether or not I want to save changes.  I don't want this dialog to come up if possible.  I would like each of these three to bypass this by saving changes for the first two, and cancelling for the third.
0
 
LVL 14

Assisted Solution

by:p_partha
p_partha earned 200 total points
ID: 9852514
change the formulas to :

Field status:="Open";
@command([filesave]);
@command([fileclosewindow])

Field status:="Closed
@command([filesave]);
@command([fileclosewindow])

try something like this for cancel:

field saveoptions:="0";
@command([fileclosewindow])

Partha
0
Technology Partners: 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!

 

Author Comment

by:brianbailey
ID: 9852659
OKay...the cancel works great.

As far as the Save Open and Save Closed buttons, is there any way to avoid the "Do you want to save" dialog that comes up?  I want to bypass this so it automatically saves (since that is what the button is).
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9852792
why do u need to do it at the form level. You can do it at the view level. Select the document and change its value by having the action button in the view level.


Have a action button in view and jsut have this formula:

field status:="Open";@true

Hope this helps

Partha
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9853063
Are you saying that Parha's code:

Field status:="Open";
@command([filesave]);
@command([fileclosewindow])

...results in a prompt to save?!
0
 

Author Comment

by:brianbailey
ID: 9853178
Yes.  It asks me if I want to save my changes? Yes, No, Cancel.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9853940
That;s why i asked u to do it at the view level. It somehow always prompts the save..Seems to be bug with Lotus

Partha
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 300 total points
ID: 9854438
A small adjustment should give a better result...

Field status:="Open";
@command([filesave]);
field saveoptions:="0";
@command([fileclosewindow]);

Field status:="Closed";
@command([filesave]);
field saveoptions:="0";
@command([fileclosewindow])

field saveoptions:="0";
@command([fileclosewindow])
0
 

Author Comment

by:brianbailey
ID: 9883398
OKay...it works.  Just one last thing.  What can I add to those that would also at the same time open the document for editing.  If I am viewing the document, the buttons appear.  Sometimes it is just about changing "status".  Can I add something to the beginning of the first two that will open the doc for editing?  If I push the botton when I am just viewing it, it closes it but doesn't edit it.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9884062
Why don't u show the buttons only to a subset of people , who are supposed to do this tweaking work of changing status. Have a hidewhen formula for this button and show only to users who satisfy that criteria.

For ex: have a role by name Admin in the database and have the hidewhen like this
@IsNotMember("[Admin]"; @UserRoles) for the buttons

Hope i am clear

Partha
0
 

Author Comment

by:brianbailey
ID: 9884087
Let me restate what I was saying.

The buttons currently only work if the document is opened for editing.  I would like them to open the document for editing if it isn't already open.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9884331
@Command([EditDocument]);
FIELD status:="Opes";
@Command([FileSave]);
FIELD saveoptions:="0";
@Command([FileCloseWindow])

Have something like this. By this u are sure that the document is edited


Partha
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9884370
No no no no!!!

@Command([EditDocument]); will place it into edit mode if in read mode... but it will also change it to read mode if it is already in edit mode!


Use:
@Command([EditDocument]; "1");
FIELD status:="Opes";
@Command([FileSave]);
FIELD saveoptions:="0";
@Command([FileCloseWindow])


Adding the "1" to [EditDocument] forces to always end up in EditMode -- switching from read mode, or leaving alone if already in edit.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9884442
Qwalette,
Although i didn't specify it as perfectly as ur's i meant only that...

Partha
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

764 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