Take the 2-minute tour ×

I have a form on which there is a text field called "Role". Onload of this form i am assigning a value to this field using javascript:


When the form opens, the required value is getting displayed in the field Role but when i try to assign the value of this field in formula language in another field on the same form it gives me blank value:

test := @GetField("Role");

The value of test comes as blank. Can anybody tell me why this is happening? Do i have to save the form before accessing the value?

share|improve this question
What if you try to display the value of Role using a button? Clicking it after the form is loaded –  Ken Pespisa Nov 8 '12 at 14:54
Which event should i use? –  Mujtaba Bhat Nov 8 '12 at 15:22
What i am trying to achieve here is, For e.g if user has two roles i want to know with which role has user entered into a lotus notes web application? is there any other way to do it? –  Mujtaba Bhat Nov 8 '12 at 15:23
I was just thinking that perhaps the value wasn't available if you were trying to access it while the form was loading. So I just mean try to show the value in a messagebox within the button's click event. You're doing this in the Notes client, yes? –  Ken Pespisa Nov 8 '12 at 19:19
What code is trying to do the assignment? I.e., where exactly is this line of code? test := @GetField("Role") –  Richard Schwartz Nov 8 '12 at 20:34

3 Answers 3

up vote 1 down vote accepted

Based on the comments you added, I believe you are trying to do something that is impossible.

A computed for display field is computed on the server, before the page data is sent to the browser.

The onload event script is executed in the browser, after the page data has been fully sent and loaded.

Since your formula `test := @GetField("Role"); executes in a computed for display field, it is clear that the onload script that sets the Role field's value has not executed yet, therefore it is correctly returning blank.

share|improve this answer
I believe you are correct. this cannot be done :( –  Mujtaba Bhat Nov 12 '12 at 13:40


test := @GetField("Role");
share|improve this answer
Henrik: that was a typo, corrected it. I am already using the double quotes but still not working :)! –  Mujtaba Bhat Nov 8 '12 at 14:40

First of all, when you are talking about "Role", ar you talking about Notes user roles, as defined in the ACL? Second, is this a Notes client application or a web (browser) application?

If it is a web application, the computed field will be computed first, and then, after the page is done loading, the Role field is populated. Why are you mixing Formula and Javascript? The JS code could as well be done in Formula, then I am sure it would work.

Could you describe what you are trying to do in a little more detail? Where do the roles come from?

share|improve this answer
Yes, i am talking about Notes user roles,. It is a web application. I believe you are correct the computed field is probably getting computed first, and then, after the page is done loading, the Role field is populated. The role is coming from another text field which is present on a header form. Can you please tell me how can i write below line of js code in formula language. top.parent.document.all.strRole.value; –  Mujtaba Bhat Nov 9 '12 at 6:50
Just make the 'Role' field computed, containing the field name you want to display, i.e. strRole. Or if it has to be editable, set the default value to the field name strRole. –  Karl-Henry Martinsson Nov 10 '12 at 15:19
Not working. Just FYI the field strRole is present on a header form and not on the same form as field Role. –  Mujtaba Bhat Nov 12 '12 at 9:10
What do you mean by "header form"? Are you talking about a parent document, from which the new document is created as a response document? If so, you can inherit the value of the field down, even if you have a different name. It sounds like you don't really know the Notes/Domino platform, I think you might want to study it a little bit more, or even get someone that is familiar with Notes to come in and help you out... –  Karl-Henry Martinsson Nov 12 '12 at 16:55

Your Answer


