@Command([OpenView])

HI, In multiple views I have a button with this code :

@Command([OpenView];“Holidays”;“Holidays”);

@Command([NavigateNext]);

@PostedCommand([OpenDocument])

The view “Holidays” is an hidden view

So This code open a document in another view

But the problem is when I close the document I’m in the hidden view called “Holidays” instead the previous view.

How can I close the hidden view when I open or quit the document?

Note: If is better to do that is LS how can I do that?

Thanks in advance

Subject: @Command([OpenView])

Here’s an example that I have in a button in a document that opens a hidden view, opens a different document based on an ID, then goes back to the hidden view, closes it, and you’re viewing the document that you wanted to see.

@Command([OpenView];“( AddContact ID)”;AddContactID);

@Command([ViewExpand]);

@Command([EditDocument]);

@Command([OpenView];“( AddContact ID)”;AddContactID);

@Command([FileCloseWindow];“( AddContact ID)”;AddContactID)

I was surprised that it worked when I was trying to find something like this, but it does. Hope it helps you get on the right track.

Subject: RE: @Command([OpenView])

Thanks K O,But this code doesn’t works for me.

He do nothing (I think he tried to open the doc and close it).

Subject: RE: @Command([OpenView])

Oups…It’s work!

My Hidden was categories in first column…

… I deselected the category and now it’s work.

Thanks a lot!

Subject: @Command([OpenView])

If you want to stick to formulas, K O has a nice workaround, but if you want to use this as an opportunity to delve into LS, here are some suggestions.

If I understand you correctly, you are using a hidden view that you don’t need the user to interact with, as well as, move to the next doc [NavigateNext] and open it. Since this is activity that is going on the background, I would use LS. LS is great for doing things in the background.

OpenView in LS will be working on the front-end opening the view for the user. However, GetView will more work in the background, obtaining the view and other methods (GetFirstDocument, GetNextDocument) will allow you to navigate through the view in the background. Then the view isn’t really appearing and there isn’t the need to close it per se.