Tips Tricks Samples

Field Editor Smart Icon

This is a really useful formula. Not one to let your users have access to but put it into an action button on an admin view and it will let you edit any field value on a document when used in a view icon or smart icon.
List := @DocFields; DataTypes := "Text" : "Text List" : "Date" : "Number";
EditField := @Prompt( [OKCANCELLIST] ; "Select a field to alter" ; "Select the field you wish to alter:" ; "CustomerReply" ; List ) ;

Edit := @Prompt( [YESNO] ; "Confirm" ; "Are you sure you want to alter the current contents of field \"" + EditField + "\"." );

RawValue := @If( Edit = 1 ; @Prompt( [OKCANCELEDIT] ;
"New Value" ; "Please enter the new desired value." ; NULL ) ;
@Return(NULL) );

DataType := @Prompt( [OKCANCELLIST] ; "Data Type" ; "Please Select the correct DataType" ; "Text" ; DataTypes );

@If( DataType = "Date" ; @SetField( EditField ; @TextToTime( RawValue )) ; DataType = "Number" ; @SetField( EditField ; @TextToNumber( RawValue )) ; DataType = "Text List"; @SetField(EditField; @Explode(RawValue; ",;:")); @SetField( EditField ; RawValue ) )