Is the above possible?
Subject: RE: How to code workspace.ViewRebuild in Formula?
Use ViewRefreshFields @Command
Subject: RE: How to code workspace.ViewRebuild in Formula?
Hi Andre, I have a frameset, in the right frame it displays a view from another database, I have a button which when click, it will hide a column from the view using " notesviewcolumn.IsHidden = True" To make the changes to take effect I have to call the ViewRebuild, this works fine, but when I open another view and return to the previous view, the column that was supposedly hidden will appear again. However, if I open the view in the designer, the column is hidden. So what I did in the PostOpen event of the view is to call the ViewRebuild, however, this makes the view to expand, the users want it collapse by default. Is this possible to achieve? Thanks in advance.
Subject: RE: How to code workspace.ViewRebuild in Formula?
It’s a bad idea to design an application so that it assumes end users have Designer access to any database. I’d like to point out there’s a column hide formula that can refer to a profile document or environment variable, making it unnecessary to modify the view design just to change a column’s hiding. This is also much nicer if the view is shared, since different users can have different settings.
For that matter, if you just check the “Allow customizations” box in the info tab of the view properties, users can choose for themselves which columns they want displayed using the menu View / Customize this view.
I’m not sure how you get the column hiding re-evaluated if you make the change yourself. You could try just re-opening the view (set target to that frame, open view). If that doesn’t work, you can certainly switch briefly to some page, and then back to the view.
(side note: In general, the more information you supply up front in your question, the better an answer you can expect).
- Andre Guirard
IBM/Lotus Development
To get your questions answered, be C R I S P Y
Subject: RE: How to code workspace.ViewRebuild in Formula?
Thanks for your info Gerard.
But the users don’t want to use the Customize This View command, all they want is to click a button. I tried using the environment variable before but the users requested to put a button Export To Excel, that’s why I changed the code that hides the column so that it is easy to determine which column to export or not using the notesviewcolumn.IsHidden. My problem now is how to make the view collapse after calling the ViewRebuild.
Is their any suggestions?
Subject: RE: How to code workspace.ViewRebuild in Formula?
I really think the way you’re doing this is bad news. Do you really insist on changing the view design each time the user clicks this button? Is it a shared view? Do you understand why I think this is a problem?
If you close and reopen the view, e.g. by switching to an intermediate page as I suggested, then you should get the column hide formula reevaluated. If the view Postopen even contains macro code @Command( [ViewCollapseAll] ), that should make all the categories close every time.
Subject: RE: How to code workspace.ViewRebuild in Formula?
I think I should change the way I code the Hide/Show column button.
Thanks for the info Andre.