Solved

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

Posted on 2003-12-01
15
297 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 50 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 75 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Missing Rules 1 307
Domino not switching to TLS 1.0 4 801
Lotes Notes 8.5.3 std can not open calendar 2 112
Migrating from Lotus Notes to Office 365 2 148
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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