Problem solve Get help with specific problems with your technologies, process and projects.

Set a field value using an external JavaScript file

How do I set a field value using an external JavaScript file? When a user selects a menu item, I would like it to call a function. The function would then set a value to a specific field. The value from that field, which would be a name of a view, would then be used to display the correct view in the embedded view.



External .js file:
function PlacevwForm(viewform){
document.all.view.src=urlAddress +
 viewform + "?OpenForm&Count=-1";
ViewName.value = "vwQAMHEASD";

Field on Form:
ViewName and editable 
(I would like this to be hidden) 

The embedded view has the Formula: 
You can do this. But remember that if you go about it this way, you must submit the form to the server; you can't just reload it, because the form would lose the value you put in the hidden field. An alternative to submitting the form is to put the viewname in the URL, like this: http://server/db/form?openform&embeddedviewname=view1. Then, on the form, you can extract that parameter to use in the formula for the embedded view. In R6 this formula would be: @UrlQueryString("embeddedviewname").

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on JavaScript for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...