Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-12-01
15
Medium Priority
?
308 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
  • 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
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.

 

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

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!

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

580 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