Edit field toolbar button for Lotus Notes


choices := @DocFields;
fullChoices := @Transform(choices; "x"; x + " = " + @Implode(@Text(@GetField(x)); ";"));
fieldName := @Prompt([OkCancelEditCombo]; "Field Name"; "Select a field name from the combobox list."; ""; FullChoices);
fieldName := @Left(fieldName; " = ");
oldValue := @GetField(fieldname);
newValue := @Explode(@Prompt([OkCancelEdit]; "New Field Value"; "Please enter the new field value." + @Char(13) + "For multivalues -- don't put space after ;"; @Implode(@Text(oldvalue); ";")); ";");
adjValue :=
@If(@IsNumber(oldValue); @TextToNumber(newValue);
@IsTime(oldValue); @TextToTime(newValue); newValue);
@If([email protected](adjValue);
@Do(@SetField(fieldName; adjValue); @Prompt([Ok]; "Field change completed"; "Old field value: " + @Text(oldValue) + @Char(13) + @Char(13) + "has been changed to" + @Char(13) + @Char(13) + "new field value: " + @Text(newValue)));
@Prompt([YesNo]; "Change field value"; "New value not of same type as old value. Set field to text?");
@SetField(fieldName; newValue); "")

Leave a Reply

Your email address will not be published. Required fields are marked *