I don’t undestand. Why can you not let the field on the form compute? Will the result always be wrong? Is this a one-time thing?
You say you want to “update” it. Please explain.
If the form is not opening because the results of the field are returning an error, write an agent to set the field to “” (or zero for a number field) then open and refresh and save.
Matt => my problem deals with fields computed at creation (like the date of creation, the number of the document…). So I can not do a refresh.
A bug has probably appeared during the creation of 2 documents. I haven’t found the reason of this bug yet.
The consequence is that computed fiels have not been computed during the creation of theses 2 documents (the database contains 2000 documents).
So I wanted to be abble to modify theses fields.
I will probably use the script given in the first answer. (thanks for it).
I should probably create a second topic in the forum so as to find help to solve the problem, but here is the detail :
In PostOpen script, I have several computed fields that are initialized like mydate=now() or also mynum= num+1 (where num comes from a unique document that contains a counter increase at each document’s creation)
For 2 documents, none of these fields has been initialized.
I am looking for the reason.
The script is quite simple and that made two years that 200 persons use the database.
When I have created the database, I decided to computed these fields via the PostOpen script, so I have put a nonuse value (“1” in my case) in the value attribut of each field.
I have an agent which does it for me. Create a agent which can run on selected document. Copy the code below and follow the comments. Hope this helps.
REM {
Name: SelectiveFieldFix
Location: Agent
Purpose:
The purpose of this agent is to enable user to replace a single field value in a document without opening to document. This agent is able to edit a text or numeric field. User will be asked the type of data type to edit and then the field name and lastly the value to update.
Note* Please use exact field name as the agent will create a new field using the field name entered if the fieldname entered does not exists.
};
DataType := @Prompt([OkCancelEdit];“Date Type”;“Please select the data type. N=Numeric and T=Text”;“”);
fieldName := @Prompt([OkCancelEdit];“Field Name”;“Please input the field name that is to be updated”;“”);
fieldValue := @Prompt([OkCancelEdit];“Field Value”;“Please input the updated field value”;“”);