[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Deleting uidoc's back-end document

Posted on 2000-04-27
2
Medium Priority
?
368 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

867 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