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
Solved

Deleting uidoc's back-end document

Posted on 2000-04-27
2
353 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 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