Manage Learn to apply best practices and optimize your operations.

Change field values from a view

Ever need to change a few values in a document that can't be changed via the form because the fields are not there or are set to hidden or computed? Usually this means we have to open designer and write an agent to change the values. This tip explains how to setup a smart icon that lets you change any field's value right from the view without creating an agent.

Put the code below into a smart icon's action formula. When you have a document selected and click the smart icon, a dialog box will popup letting you choose from a list of fields inside the document. Select a field and the next dialog box shows you the current value, which you can then edit. As a bonus, if you type in @Delete as the value, the field will be removed from the document.

Note this always changes the value to a text field, so be careful not to change any number or time/date fields.

By the way, you can input multi-values by separating each value with a semicolon.

REM "Change Field Values From A View";

tmpFields := @DocFields;
tmpLastFieldChosen := @Environment("SI_LastFieldChosen");

tmpChangeField := @Prompt([OKCANCELLIST]; "Change Field"; "Please choose the field whose value you'd like to change"; tmpLastFieldChosen; tmpFields);

REM"Save State"; @SetEnvironment("SI_LastFieldChosen"; tmpChangeField);

tmpValue := @Prompt([OKCANCELEDIT]; "New Value"; "Please enter the new value for the field or type @Delete to delete the field."; @Abstract([TextOnly]; 200; ""; tmpChangeField));

@If(tmpValue = "@Delete"; @SetField(tmpChangeField; @DeleteField); @SetField(tmpChangeField; @Trim(@Explode(tmpValue; ";"))))

This was last published in April 2001

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...