Question

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:

document.forms(0).Role.value=top.parent.document.all.strRole.value;

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?

Was it helpful?

Solution

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.

OTHER TIPS

Try:

test := @GetField("Role");

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top