I have some calculations I have changed in a form. I have several hundred documents that need to be refreshed to recalculate the fields. Is there a way from a view to select multiple documents and Save and Refresh them so that I don’t have to go into each document and click save?
Much thanks in advance!
Subject: Save and Refresh Documents from a view
Taken from Designer Help:
Refreshes the fields of all the selected documents in a view or folder.
Syntax
@Command( [ToolsRefreshSelectedDocs] )
Usage
A database must be open at the view or folder level and at least one document must be selected.
This command does not work on the Web.
Subject: RE: Save and Refresh Documents from a view
I tried this in a menu agent and received a error:
@Commands & other UI Functions are not allowed with this search type, please select “None” as your runtime target.
Any suggestions?
Subject: RE: Save and Refresh Documents from a view
Charles,
Put Mark’s code in a SmartIcon
Bob
Subject: RE: Save and Refresh Documents from a view
Test it first! Depending on field formulas and QuerySave and other events, you may end up calculating a lot of fields which should not be recalculated. For instance, your name may be updated into an authors field or an edit-history field may get more stuff appended to it. Similarly, do you have any agents that act on all new/modified docs? If any of the above is true or if the form is very complex with many fields and calculations, you may be better off writing code to update only the fields of interest. This potentially will run much faster and will avoid setting unrelated fields.
Subject: Calculated fields that rely on vales of other calculated fields
Good thinking Doug. I don’t have any agents that run on new documents and I did test it our on a few documents before applying it to all.
A quick question for you. I have fields that rely on values of other calculated fields. Some of these fields do not calculate properly unless I save twice. I have put 2 refresh statements in my post save command and in a couple of field exit commands. Is this what you would do?
Subject: RE: Calculated fields that rely on vales of other calculated fields
move the fields around on the form so that the “source” fields are above the “dependent” fields. (Domino has a top-to-bottom processing order.) If the UI requires that any of these field relationships are upside-down, then create a hidden version of one of the fields to coreect the order.
Then you won’t have to calculate twice.
Subject: RE: Save and Refresh Documents from a view
Also make sure people don’t have the documents locked for editing!
Subject: That did the trick
Thanks Bob