Solved

Blocking the Do you want to save your changes prompt

Posted on 2004-08-03
30
1,873 Views
Last Modified: 2013-12-18
On a "submit" button action, I change the value of a field just before doing a @Command([FileSave]);

But the alert Do you want to save your changes? always prompt...

Is there a way to block this?  Is there also a way to block people quitting your form with the tab, and so, force them to use the action buttons?

I know it could looks like 2 questions, but in fact, I only want to know if we can manage, overpass or block the Lotus prompts and alerts...
0
Comment
Question by:barbotte
[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
  • 17
  • 8
  • 3
  • +1
30 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11706921
Add a "Computed for display" field to your form and specify its default value as "1". This iwll not happen.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11706975
>> Is there also a way to block people quitting your form with the tab, and so, force them to use the action buttons?

I am not sure what you mean by TAB. If you mean you wanna prevent users from switching windows when he/she is editing document, it will not be easy. The solution lies in the NotesUIWorkspace.DialogBox. See this example from Designer Help:

Sub Click(Source As Button)
  Dim workspace As New NotesUIWorkspace
  Call workspace.DialogBox ( "policy", True, True, True, True, False, False, "Policy" )
End Sub

You can do something sminilar to get it to work.
0
 

Author Comment

by:barbotte
ID: 11707038
I already have a Computed for display field, which I gave a default value

??
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 19

Expert Comment

by:RanjeetRain
ID: 11707052
>> Add a "Computed for display" field to your form and specify its default value as "1". This iwll not happen.

Correction!

Add a "Computed for display" field named "SaveOptions" to your form and specify its default value as "1". The presence of this field makes Domino silently save the document while closing, if modified.

If you wanna discard changes while saving, specify its default value as "0".
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11707062
>> If you wanna discard changes while saving, specify its default value as "0".

If you wanna discard changes while CLOSING, specify its default value as "0" :)
0
 

Author Comment

by:barbotte
ID: 11707145
Still prompting the Save dialog box with a Computed for Display field named SaveOptions

Does the type is Text?  I guess...  Do the name of the field start with a dollar sign ??
0
 

Author Comment

by:barbotte
ID: 11707202
Here's the exact code I've got on the action button:

@If(LeStatus = "Initial" ; FIELD LeStatus := "Assigned" ; FIELD LeStatus := LeStatus);
@Command([FileSave]);
@Command([FileCloseWindow])
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 150 total points
ID: 11707272
SaveOptions should be a "Computed for Display" field of TEXT type.

Also, modify your code like this:



FIELD LeStatus := LeStatus;
FIELD SaveOptions := SaveOptions;


@If(LeStatus = "Initial" ; @SetField("LeStatus"; "Assigned"; "");
@SetField("SaveOptions"; "1");
@Command([FileSave]);
@Command([FileCloseWindow]);


Check for the syntaxes. I might have left a typo.
0
 

Author Comment

by:barbotte
ID: 11707427
Is there missing a right parenthesis somewhere?  And an error tells me the @If takes "an odd number of arguments"
0
 

Author Comment

by:barbotte
ID: 11707567
I really tried working out with the parenthesis and the empty "" but it still do not work!

I got this, added a parenthesis after "Assigned":

FIELD LeStatus := LeStatus;
FIELD SaveOptions := SaveOptions;

@If(LeStatus = "Initial" ; @SetField("LeStatus"; "Assigned"); "");
@SetField("SaveOptions"; "1");
@Command([FileSave]);
@Command([FileCloseWindow]);
0
 

Author Comment

by:barbotte
ID: 11707635
increasing Point Value of the question!
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11707955
FIELD LeStatus := LeStatus;
FIELD SaveOptions := SaveOptions;

@SetField("LeStatus"; @If(LeStatus = "Initial" ; "Assigned"; LeStatus));
@SetField("SaveOptions"; "1");
@Command([FileSave]);
@Command([FileCloseWindow]);
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11712129
taking from RR,
maqke it like this:

FIELD LeStatus := LeStatus;
FIELD SaveOptions := SaveOptions;
@SetField("LeStatus"; @If(LeStatus = "Initial" ; "Assigned"; LeStatus));
@SetField("SaveOptions"; "1");
@Command([FileSave]);
@PostedCommand([FileCloseWindow])
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11712661
Hi Mady... hows it going!
0
 

Author Comment

by:barbotte
ID: 11715184
Still do not work...  Plus it creates another bug:

Before, on a completely different button of the same form, I was changing the value to something else...  THis other button (a kind of Send button)

@SetField("LeStatus"; "Sent");
@Command( [FileSave] );
@Command([FileCloseWindow])

But now, this button do not works anymore, and I see the value change for hafl a second, and it comes back to the old value again, and the Save system prompt appears...

???
0
 

Author Comment

by:barbotte
ID: 11715581
Well, forget the bug about the other button, it's because the Status field must be Editable.  If it's Computed in anyway, the value won't change...

But still, the Save system prompt always appears...
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11716047
YOu would be better sorting out your problems one-by-one than all at once. For one momnet, leave out your other fields and then test it. If it works you can convert back. Checklist:

1. Do you have a SaveOptions field?
2. Make its type 'Editable'.
3. Is the data type of the field 'TEXT'?
4. Is the default value "1"? (With quotes, so that it is a TEXT value, witout quotes it is a numeric value)
5. Make sure that you do not have any LotusScript code in your QuerySave, PostSave events.

Now try closing the form. Does it still prompt you to save?
0
 

Author Comment

by:barbotte
ID: 11716509
Checklist followed.

If I do not modify the form (don't enter any data) it sure do not prompt me to save changes.  But if I make a change (enter some data in only 1 field) then yes, it still prompt me Do you want to save...
0
 

Author Comment

by:barbotte
ID: 11717110
Increasing again Point Value to 120!

I notice that If I remove the @Command( [FileCloseWindow] ); the prompt does not appear, but the window don't close, of course!  But the change of value happens without system prompt...
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11720364
suspect you are going about this the wrong way.  I don't want to know the keystrokes, etc. you are trying to make happen.  I want to know, what is the purpose of doing all this?  If I understood your app better, I could probably tell you exactly what to do.  The SaveOption business is a workaround, it sounds like you really wnat the doc to save and the window to clos eimmediately using your button.  Perhaps you have a PostRecalc event with code in it?
0
 

Author Comment

by:barbotte
ID: 11725357
The thing is that I've got a Status field wich change automatically (but NOT manually) according to the data entered in other fields.

Example: by default, the status field is "incomplete"... The person can change the document in anyway he wants and save it, the status will remain "incomplete".  Only when he Sends the document, the status change to "initial"...

Then, another person receives it, and enter some more data, so the status changes to "assigned"...

So when I load the document, I've put a default value to "incomplete"...

Then on the SAVE button, but only AFTER the document was Sent, I check if some fields are filled.  If they are, then the status change to "assigned", if they're empty, then the status is still "initial", which mean the document was sent, but not seen by the 2nd person...

But the only thing I want, is to stop the system alertbox saying Do you want to save your changes?

This system alert seems to pop out only when I try to close the document, even if there is an @command([FIleSave]) just the line before!
0
 

Author Comment

by:barbotte
ID: 11725389
The only thing changing in the document is the Title, depending if it's a newdoc or and old one.

No other scripts or formulas are in the form itself, only on the action buttons or on the fields.
0
 

Author Comment

by:barbotte
ID: 11735859
Though one, isn't it?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11738825
Do you have it set to automatically refresh fields?

FOr the thing you are doing, you really ought to just use Refresh Fields On Keyword Change, which would prevent the whole problem.
0
 

Author Comment

by:barbotte
ID: 11752395
In my form properties, I only have the "render pass through HTML" checked, no other option are checked.

Where's the option with "...on keyword change"??

The only option about refreshing is "Automatically refresh fields", which is not checked.

Should I check it?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11761410
Enable :Automatically refresh fields in form properties box and try.
0
 

Author Comment

by:barbotte
ID: 11777423
Do not work...

increasing again question by 30 point to reach 150
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 11782110
Can u post ur mail send code and where it is coded? is it formula or Script doing in QuerySave?
 
Let me explain what u have to do.
Try to create a new database and a form in it.

Create a SaveOptions field. Editable and text. Default is "0".
Create LeStatusm field and make default value "Initial"
Compose this form and Click on the button which had the below formula:
FIELD LeStatus := LeStatus;
FIELD SaveOptions := SaveOptions;
@SetField("LeStatus"; @If(LeStatus = "Initial" ; "Assigned"; LeStatus));
@SetField("SaveOptions"; "1");
@Command([FileSave]);
@PostedCommand([FileCloseWindow])

it should not prompt for savedialog and once the doc is saved and closed, check the field value LeSATATUS. it should have "Assigned" as the value.

Once the above test is completed, let us know the result.
thanks.
0
 

Author Comment

by:barbotte
ID: 12125900
madheeswar, I've put your formula in the Formula zone of the Action button...

Bug still appear...
0
 

Author Comment

by:barbotte
ID: 12127264
well, here's the solution:

@If(@PostedCommand([FileSave]); @PostedCommand([FileCloseWindow]); "")

This doesn't make the Save confirmation popup appear.

But this do:

@Command([FileSave]);
@PostedCommand([FileCloseWindow])

I'll give the points to RanjeetRain as it's the first who pointed out the SaveOptions field thing, which helped me solve the problem...
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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 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