Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deleting uidoc's back-end document

Posted on 2000-04-27
2
Medium Priority
?
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 200 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

618 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