Solved

Deleting uidoc's back-end document

Posted on 2000-04-27
2
351 Views
Last Modified: 2013-12-18
Hi,
i have an uidoc(doc1). With an action button in it i want to create another document(doc2), copy some of the field values of the uidoc(doc1) to the new doc(doc2), close the uidoc(doc1), open the new doc(doc2) as uidoc(doc2) then delete the parent document(doc1).
I cant delete the parent doc 'cause it says can't delete document that has been instenciated by a uidoc or something like that.
I have looked to the help, it says you must close the uidoc, find again the the by it's universalID and then i will we able to delete it...it didn't work.
Good luck,
Koray.
0
Comment
Question by:koray_uygun
2 Comments
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 50 total points
ID: 2757353
What it is saying is that you have obtained the the doc1 notesdocument object via a notesuidocument and therefore  you can't delete it here is a work around , what you need to do is  close the uidoc1 , get the noteid of doc1,  remove the reference to the doc1 and get the reference to doc1 via a backend class like a notesdatabase and then delete it

heres the code to do it


Dim Sess As new Notessession
Dim ThisDB As NotesDatabase
Dim noteID as String

Set ThisDB = Sess.CurrentDatabase

..... Your Code goes here .....


' This gets the noteID to the document
 noteID = doc1.noteid
' This remove the in memory object            
  Delete doc1
' This closes the uidoc1
 Call uidoc1.Close()

' This finds the document via a backend class and deletes it
Set doc1 = thisDB.getdocumentbyid (noteID)
Call doc1.remove(True)

0
 

Author Comment

by:koray_uygun
ID: 2758421
Thank you again Simon.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Capture Serial Data in Lotus Notes Database 8 255
How to connect (using VBA) to a IBM Notes webmail server 3 231
Domino Server 2 70
how to install domino server on suse linux 18 78
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…
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 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

13 Experts available now in Live!

Get 1:1 Help Now