Solved

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

Posted on 2003-12-01
15
294 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
 

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise 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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

16 Experts available now in Live!

Get 1:1 Help Now