Tip

Modify hidden or internal fields without writing an agent

View member feedback to this tip.

Have you ever want to quickly modify "hidden," "internal" or "system" fields of a document but without having to build an agent?

The quickest way is to use a toolbar button!


Imagine you have a document with a system field like "Status". This field is mostly computed and can only be modified through some code behind a button like "Send for Approval" or "Accept the Review." But this code may prevent the change of the Status, even if you have author access to the document.

You want to modify the "Status" field, but you don't have the designer access and the "create private agents" attribute.

The quickest solution is to add a button in the toolbar, and code the @formula to modify the field:

For R6:

  1. Go to File-Preferences-Toolbar Preferences
  2. In the Customize tab, click on New-Button
  3. Enter the caption text, optionnaly a popup and an icon,
  4. Add the code to modify the document fields, for example: FIELD Status := "Wiating for Review";
  5. Save your toolbar button by clicking on OK
  6. Go to your database and select the document you want to change
  7. Then click your button in the toolbar!

Remember that a single toolbar button is available for any database!

MEMBER FEEDBACK TO THIS TIP

I picked up a more versatile version of this tip and have implemented it in a number of my Web apps with the button only visible to Notes Clients. It allows me to pick which field I want to change then enter a new value. The main drawback is that it can't set the value in a field that hasn't allready been set in the document. The idea is the same use an action button but use the following formula:

fieldName := @Prompt
([OKCANCELEDITCOMBO]; 
"Field Name"; "Enter Field 
Name."; ""; @DocFields); newValue 
:= @Prompt([OKCANCELEDIT]; "New
 Field Value"; "Please enter new value."; "")
; @SetField(fieldName ;newValue)
-- Steve C.


Do you have comments of your own? Let us know.

This was first published in March 2003

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.