I’ve found that a field value on a View Template is not being recognized. For example, the following code is from an agent that’s run by the WebQuerySave. The variable ‘check’ contains the value of the field ‘Employee’. However,‘check’ is null when displayed by an alert statement.
Dim context As NotesDocument
Dim check As String
Set context = session.DocumentContext
check = context.Employee(0)
Print “<script language=”“javascript”“>”
Print |alert(" ‘|& check & |’ ");|
Print “”
I’d appreciate any suggestions on how to capture a field value on a View Template.
Thanks.
Subject: Capturing a Field Value on a View Template
$$Templates are not opened in edit mode, and read-mode forms don’t have fields on the web. You would need to create a field in passthru HTML – or better yet, create a plain old JavaScript variable with the desired value using passthru HTML.
Subject: RE: Capturing a Field Value on a View Template
I should have indicated that the field was converted to HTML, but its value is still not being displayed in the alert statement. The intent is to have the View Template’s field updated by a child window and then pass this value to selected documents. I’m not sure I follow the suggestion on using a variable. In my code, I attempt to capture the field value in a variable, but the variable’s value is not being recognized by the alert statement. Could you please clarify what you meant about using a variable?
Thanks.
Subject: RE: Capturing a Field Value on a View Template
You’ll need to lay this out a heck of a lot more clearly. $$Templates aren’t editable by definition. How are you creating the field in HTML? I’m not sure I follow “pass the value to selected documents”. I ain’t all that dense, but I’m not following you at all.
Subject: RE: Capturing a Field Value on a View Template
I added a field called Employee to a View Template and hard-coded this with the value “Smith” (although the field will actually be updated through a child window). This field on the View Template was converted to HTML. The code in my original post is from an agent run by the WebQuerySave. This shows that the field value is passed to a variable, but the variable displays a null in the alert statement. It’s therefore not apparent how the field value on a View Template can be captured. (I’d like to pass this value on to selected documents.)
Thanks.
Subject: RE: Capturing a Field Value on a View Template
Okay. This sounds a little less like a View Template scenario the more I hear. Are you actually opening a Form that happens to have an embedded view on it? (A $$ViewTemplate is meant to open automatically when you open the view by URL, and should not normally be opened directly.)
Am I getting this mush right at least? If so, we can go on from here.