Solved

Blocking the Do you want to save your changes prompt

Posted on 2004-08-03
30
1,760 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
  • 17
  • 8
  • 3
  • +1
30 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
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
Comment Utility
>> 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
Comment Utility
I already have a Computed for display field, which I gave a default value

??
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
>> 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
Comment Utility
>> 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
increasing Point Value of the question!
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
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
Comment Utility
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
Comment Utility
Hi Mady... hows it going!
0
 

Author Comment

by:barbotte
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:barbotte
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Though one, isn't it?
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
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
Comment Utility
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
Comment Utility
Enable :Automatically refresh fields in form properties box and try.
0
 

Author Comment

by:barbotte
Comment Utility
Do not work...

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

Expert Comment

by:madheeswar
Comment Utility
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
Comment Utility
madheeswar, I've put your formula in the Formula zone of the Action button...

Bug still appear...
0
 

Author Comment

by:barbotte
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

17 Experts available now in Live!

Get 1:1 Help Now