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?
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.