I'm trying to add a computed date to a view but the column is blank. The compdate is generated within an action button. When the document is completed, the person clicks the Mail Completed Action button which gets routed to the team leader. At that time the current date is added to the compdate field.
I've verified that the date is inserted in the field. When I use that field to populate a column in the view, the column is empty. I'm trying to remember but I think I remember an issue with computed fields in a column. Is this correct? If so, I cannot remember the workaround.
Any insight would be greatly appreciated. Thank you.
You creating the field but it might not saved in the document. So that is reason the field value not appearing in the view.
Please verify the view selection formula as well.
Maildoc.Form = Memo Maildoc.compdate := @Now; Maildoc.sendTo := leader; Maildoc.copyTo := ""; Maildoc.blindCopyTo := ""; Maildoc.subject := "Action Complete"; Maildoc.save(true,false) <--- Before sending the mail to your Team Lead
The "Computed Forf Display" field type cannot be used in view (like RichText fields) because Summary info is not set. For computedfield type "Display" can be tricky, so first check your form and set the field to "Computed then composed" or "Computed". If you change the field type you need to create a small agent to (LotusScript) computewithform to set correcty the symmary information on the field. Once it is done, you'll be able to get the info in the view (if any value is set).
For rich etxt field, the hack is to change the symmary property of the field, but well....it is limited is size.
It was the field type that tripped me up. The date field used to populate the view column was set as "Computed for Display". I changed the field type to "Computed" and the date appeared.
I knew I was missing something simple. Thank you for the guidance. Have a good day.
Please post your complete action button code. With the code you post it is impossible that the values are in the field as your code only assigns values to temporary variables and not to fields as Shigemitsu Tanaka correctly mentioned.
If your code really sets the values and you then close the document without saving, then the values would not be persisted.
And one last thing that could be wrong is an item "SaveOptions" with the value "0" in your document. Then your changes would never be saved.
A "typical" button to do what you seem to want is:
FIELD compdate := @Now;
FIELD sendTo := leader;
FIELD copyTo := "";
FIELD blindCopyTo := "";
FIELD subject := "Action Complete";
You have mentioned "I've verified that the date is inserted in the field", so I assume you are using "FIELD" keyword and that the field is actually created and saved in the document and it contains the date value in it. If this assumption is wrong then you need to relook at your code and use "FIELD" keyword as suggested by Shigemitsu Tanaka.
Make sure that the field data type is "Computed" and not "Computed for display" in the form as suggested by Jerome. And the default value should be field name itself. A "Computed for display" is not saved in the document.
Also, check if there is any "SaveOptions" field with value "0" in the document as suggested by Torsten. This disallows the document to be saved.
If everything is already in place then try to change the column properties > 4th tab (Advanced format) > Change style from "General" to "Date / Time".
Another option that you can try is to use this formula in the column value.