• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 611
  • Last Modified:

@Command([FileCloseWindow]); collapsed

Hi,
I used the following code to return to a frameset for a button action
however occasionally after the current form is closed it prompts saying
cannot find the Sales Frameset. Any clues?
Thanks !!

@Command([FileSave]);
@Command([FileCloseWindow]);
@PostedCommand([OpenFrameset];"Sales")
0
damoncwk
Asked:
damoncwk
  • 3
  • 3
  • 2
  • +2
1 Solution
 
madheeswarCommented:
@Command([FileSave]);
@Command([FileCloseWindow]);@PostedCommand([FileOpenDatabase];"vmokshatest/vmokshacert":"Pratima1/oppmgtsys.nsf")

The above will open the database with the frameset (if ur using the Sales frameset when database open.

try the code.
0
 
RanjeetRainCommented:
Did you try this?

@Command([FileSave]);
@Command([OpenFrameset];"Sales");
@PostedCommand([FileCloseWindow]);
0
 
damoncwkAuthor Commented:
Hi RanjeerRain,
Yes i did try this but the window of the form is still not closed....
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
madheeswarCommented:
did u tried mine?
0
 
damoncwkAuthor Commented:
madheeswar,
yes i did try yours and it did work
however it still prompt asking if I want to save the changes
is there any way that i can save the file without the app promting the question?
Thanks!!!
0
 
damoncwkAuthor Commented:
madheeswar,
the FileCloseWindow command didnt work though though
the frameset is opened.....
0
 
madheeswarCommented:
create SaveOptions Field and assign 1 as default value. it will stop prompting.
0
 
RanjeetRainCommented:
Try this combi,

@Command([FileSave]);
@PostedCommand([OpenFrameset];"Sales");
@Command([FileCloseWindow]);
0
 
HemanthaKumarCommented:
What version of notes do you have ?

Formula always have exceution priorities...So can you do this in LS ?

~Hemanth
0
 
qwaleteeCommented:
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow]);
@PostedCommand([WindowWorkspace]);
@PostedCommand([AddDatabase]; @DbName);
@PostedCommand([OpenFrameset]; "Sales");

Explanation:

Your code relies on knowing what will be on screen as each command is executed.  It assumes that after the FileSave, the window will still beopen, but closable.  After the FileCloseWindow, it assumes the database will be on screen... some view or frameset.  Usually that's true.  Then, when teh OpenFrameSet executes, it opens the Sales frame of the database that is currently on screen, which again is usually the same database.

But, let's say while the form was on screen, the user opened mail, then clicked back to the tab containing your form.  After the file close window, mail is on screen, so it tries to open a Sales framset in mail.  That won't work.

In addition, there are some funky things with FileCloseWindow... Notes delays executing the FCW until the other commands have finished.  So, it will actually open the frameset before closing teh form, then just close the form.

The latter problem is worked around by making ALL the commands work like FCW, using PostedCommand instead of @Command.  FCW is always treated as FCW, but the other can also be made to do the same.

As to the "which window is open" problem, all you need to do is make sure your database is active on screen before opening the framset.  the above works, though if your users do not normally use the workspace, it will leave a workspace window open.  You can work around that by, insted of going to workspace to force active DB, instead, open a temp view in your DB, open frameset, open the same temp view window, and close it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now