2
votes

I have a form with a computed value that is supposed to display the contents of a hidden field. If I replace the formula on computed value by something, like "text to show" it displays OK. But when I assigned it to the name of the hidden field it doesn't show field contents. I want to assign the field a value and display it on computed value. I thought it was enough to assign computed value field name. Do I have to do something else?

Your advise much appreciated

Thank you so much in advance

Carlos

3
What is the type of the hidden field: computed, computed for display, computed when composed or editable. Also, does the computed field come before or after the hidden field on the form?Richard Schwartz
@Richard, thanks for your reply. The hidden field is text type. And Editable. The computed field does come after the hidden field. Field Name is "Details_Text". When I add Details_Text to computed field nothing is displayed, but if I add quotes, like "Details_Text" then it is displayed.Carlos Botelho
Are you creating a new document, or editing an existing document?Richard Schwartz

3 Answers

0
votes

In Lotus Notes forms, fields are evaluated from the top of the form to the bottom, left to right. In order for the computed field to reference the hidden field's value, that value must be assigned to the hidden field before the computed field is evaluated. For an existing document with a computed field referencing a hidden text field, it doesn't matter what the order of the fields is unless an agent or formula somewhere might have updated the hidden text field. For a new document, however, the order does matter: the hidden field must come before the computed field, otherwise it won't have been initialized yet when the computed field formula references it.

0
votes

I realise that this is an old text, but I've experienced similar and found another possible solution. It could be that the formula used for the computed text has an error (such as a type mismatch which is not displayed and goes unnoticed by the programmer.

For example: I had a formula which read "£"+IPRTotal which looked OK, I would have expected Notes to coerce this to a string, but it seems to just fail silently leaving the computed text incomplete. The answer is to eliminate the type mismatch like this: "£"+@text(IPRTotal).

Hope that helps someone.

0
votes

Assumption: This is a Notes Client app.

The standard setup for this is to make the hidden field computed to it's own value using it's own name or @ThisValue. Then make the display field a Computed for Display type. What others have said about ordering is correct.

How you "assign the value" is key here.

  1. If the value is set before the document is opened edit mode (i.e. agent). Above will work.

  2. If you're doing it with script: Are you using doc or uidoc?

    a). Using doc.fieldname=value will only update the value of the field on the backend document. It won't effect the ui unless you do a uidoc.refresh

    b). if you're using uidoc.FieldSetText() then include a uidoc.Refresh() command after setting the hidden field value. This will force the recalculation of your CFD.

If you need help debugging, post what you're actually doing and we can have go at it.