Solved

How can I update current field with Lotus Scripts

Posted on 2000-05-09
4
313 Views
Last Modified: 2013-12-18
When Initialize form I want to calculate the value of field in this form with Lotus Script ? But I can't do it now . My form is the $$ViewTemplate for viewname and I open it on web .I want to use the Lotus Scripts to make the dynamic webpage.
My Domino server is release 4.63
and this is my sample code

I use this code on field name ViewList
Sub Initialize
     Dim uidoc As NotesUIDocument
     Dim  doc As NotesDocument
     Set doc = uidoc.Document
     Call doc.ReplaceitemValue("ViewList","Hello")
     Call doc.save(True,False)
     Call uidoc.reload
End Sub

I want to show all of view in this database
to be the link on web .I want to know how can I update this field via Lotus Script?

Thanks you for your kindness
MAC
So sorry my engligh isn't good enough
0
Comment
Question by:mackrub
4 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2792284
Hi MAC

You can use the domino $$Viewlist field to list available views in the database.


Good Luck
~Hemanth
0
 

Expert Comment

by:sam_clayton
ID: 2792449
Which event is driving this code?
Remember that for the web the only events triggered for a form are WebqueryOpen and WebQueryClose (and these can only call agents)
Therefore these events IIRC will not allow you to manipulate uidoc data.
0
 
LVL 4

Accepted Solution

by:
stamp earned 100 total points
ID: 2794100
Hi  mackrub,

if you want to fill a form field by LotusScript on web, than you can do it only by usin background objects not UI objects.

You can not run any field LotusScript code. You have to move the code to an agent.
This agent can  fiel fields before display to browser and after submiting from browser.
I have transformed your UI LotusScript code into one background agent called by WebQueryOpen event.

Create one shared agent with option: "Run once (@Commands may.."
This is Initialize event:
Sub Initialize
      Dim s As New NotesSession
      Dim doc As NotesDocument
      Set doc = s.DocumentContext
      doc.ViewList = "Hello"
End Sub

That means: after assaigning DocumentContext to a doc, you can assign any value to any field like this:
                doc.AnyField = "AnyValue"

But this all is not necessary! HemanthaKumar is right. Place anywhere into your form named "$$ViewTemplateDefault" a field named "$$Viewlist"
This is enough to get the complete list of all views (clickable!).

Regards,
stamp
0
 

Author Comment

by:mackrub
ID: 2857446
Answer accepted
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now