Lotus Notes: Changing the field value of a document

352420 pts.
Tags:
Lotus Notes Forms
LotusScript
In my Lotus Notes form, I have a computed-value field (it's called "NewOrdProdUID") which is set correctly with the unique ID of another Lotus Notes existing document. I'm trying to change the value of a field "NewProdAvail" in the existing document through LotusScript. Here's what I'm working with so far:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim ws As New NotesUIWorkspace
 Dim uidoc As notesUIDocument
 Dim odoc As notesDocument 

 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set uidoc = ws.CurrentDocument

 Set odoc = db.GetDocumentByUNID(uidoc.FieldGetText("NewOrdProdUID"))
 Call odoc.FieldSetText("NewProdAvail", "0")
 Call odoc.Save(True, True)
End Sub
With that code, the value of the field keeps staying the same. What should I do? Please help!

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. first see the field “NewOrdProdUID” in your program ,you are not modifying this field

2. you are trying to modify another field ‘NewProdAvail’ by getting the reference of document id  from the field ‘NewOrdProdUID’
3. code used below is not correct it is a backend doucment and you are using ui method to modify the field value which is wrong.{Note: if it is an open document you are editing then you could have used uidoc’ object}
So your requirement should be clear and you must debug to find such mistakes.
 Call odoc.FieldSetText("NewProdAvail", "0")

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following