Ask the Expert

Use scheduled agent to refresh all @DBLookup/computed values

I am trying to refresh all @DBLookup/computed values within a document using a scheduled agent.

Manually, this does the job: @Command([ToolsRefreshAllDocs])

I have tried using the LotusScript below, too, but this doesn't seem to work either:

If doc.computewithform
(True, False) Then 
Call doc.save(True, False) 
 

Do you have any suggestions?
ComputeWithForm does work with @DBLookup as well as other computed fields, but you have to consider the different context of code running on your workstation versus on the server. The current username is the server name rather than yours, and if you want to refer to a database on the current server, you should use "" in your formula rather than a hard-coded server name. To write a formula that will work both on the server and on a workstation, use "" to refer to the current database, or if to another database on the same server, use @Subset(@DbName; 1) : "filepath", or use the replica ID of the second database.

If the database is on another server, you may need to make sure there's a "trust" relationship between the servers. The Server configuration document of the second server in the server address book contains a field on the Security tab labeled "Trusted servers." It should list the server running the agent.

Do you have comments on this Ask the Expert Q&A? Let us know.

This was first published in October 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: