You Can View User Feedback To This Tip
Would you like to change field values without creating an agent? Here is how.
Code
Go to: File>Preferences>Toolbar Preferences
In the Customize tab, click on New Button.
Enter the caption text, optionally a popup and an icon.
In formula window enter:
fieldName := @Prompt([OkCancelEdit];
"Field Name"; "Enter field name."; "");
newValue := @Prompt([OkCancelEdit];
"New Field Value"; "Please enter new value."; "");
@SetField(fieldName ;newValue)
All done.
When you click button first enter field name and then new value (of course don't forget to mark documents that you want to change field values.
USER FEEDBACK TO THIS TIP
To Robert Ficek's developer tip of 4/14/2003 I have changed the OKCancelEdit to OKCancelEditCombo and used @DocFields to retrieve all of the field names in the document. This saves me the time of looking them up through document properties or checking the form design for spellings. Thanks Robert for the leg up.
fieldName := @Prompt
([OKCANCELEDITCOMBO]; "Field Name";
"Enter Field Name."; ""; @DocFields);
newValue := @Prompt([OKCANCELEDIT];
"New Field Value"; "Please
enter new value."; "");
@SetField(fieldName ;newValue)
Rod Hogeland