Deleting Draft

Hello guys
How do i delete a draft document automatically after it is added?
i browse through the database and found no reference in draft document tables to the new added document
and there is no backward reference for the targeted document too
I wish to delete a draft document after is has been added so that the user doesn't have to delete it manually all the time
Thanks

Hello,
Well... I'm not sure it's a good idea to delete draft document automatically after it is added...
Draft documents are created when user want to save the document and so can continue it later.
If you delete automatically the drafts documents when it is added, then the user will not be able to save a document (to continue it later)
btw, I don't think DI API or UI API can tell you when a draft document is added.
I have 2 solutions if you really want to do that :
1) If you don't want any draft document, you can delete all of them each hour (for example)
        Dim oDoc As SAPbobsCOM.Documents
        Dim rs As SAPbobsCOM.Recordset
        oDoc = CType(SBOcomp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts), SAPbobsCOM.Documents)
        rs = CType(SBOcomp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset), SAPbobsCOM.Recordset)
        rs.DoQuery("SELECT DocEntry FROM ODRF")
        While Not (rs.EoF)
            If oDoc.GetByKey(rs.Fields.Item("DocEntry").Value) Then
                oDoc.Remove()
            End If
            rs.MoveNext()
        End While
2) If you want only delete the last one, and if some field contains some data, you will have to set a trigger on the table ODRF that will record the DocEntry in another table (in a usertable for example) that you will read each hour to delete the draft document (like 1) )
But I'm not sure SAP like we add trigger in the database

Similar Messages

  • Using iPad mail program I have a draft of an email. I attempted to "cancel" and "delete draft" but it is still on my screen even after shutting down and restarting. How do I exit so that I can use other mail functions?

    Using iPad mail program I have a draft of an email. I have attempted to "cancel" this and "delete draft" but the email stays on my screen. How can I exit this so that I can use other email functions?

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Can't delete Drafts

    For some reason, there is no way to manually delete drafts on this IMac.
    I'm using Mail without any extensions, and three accounts in total.
    3 pop boxes on an internal server.
    They disappear in the list view, but the number of drafts aren't changing. Also, after switching folders the deleted mails are still there. Also, dragging the draft to the trash has no effect.

    For some reason, there is no way to manually delete drafts on this IMac.
    I'm using Mail without any extensions, and three accounts in total.
    3 pop boxes on an internal server.
    They disappear in the list view, but the number of drafts aren't changing. Also, after switching folders the deleted mails are still there. Also, dragging the draft to the trash has no effect.

  • Deleted drafts - message headers remain with blank content (Gmail IMAP)

    I thought I had solved the "zombie" drafts problem yesterday. I changed my Gmail.com IMAP settings to "auto-expunge off" and "immediately delete the message forever". My multiple zombie drafts finally disappeared from my Drafts box. But today, the multiple headers for all those deleted drafts have returned to my Drafts box, plus more for emails I sent since yesterday. There are 34 for one message. But the content panel for each of those headers is a completely blank, gray box. I do want to store my drafts on Gmail.com. Any help?

    Hmm, turns out my iMac Apple Mail has been resetting the Mailbox activity settings for some random reason which would explain the drafts problem. Wonder why?

  • I have two new problems that started today- I can't delete drafts and I can't move emails from my inboxes to folders in mailboxesleft column ( I work on a MacBook 10.7.5- I have 2 active email accts in Apple Mail

    I have two new problems that started today- I can't delete drafts and I can't move emails from my inboxes to folders in mailboxes in the far left column. I work on a MacBook 10.7.5- I have 2 active email accts in Apple Mail. Any suggestions for steps I can take short of going to genius bar?

    However after part of the Itune update completed a message came up on the screen
    saying   "The feature you are trying to use is on a net work resource that is unavailable.
    Which particular .msi file does the message go on to say cannot be found? (Several different .msi files might be mentioned in this context: itunes.msi, bonjour.msi, AppleSoftwareUpdate.msi, etc.)

  • Deleting draft documents in draft process

    Hello,
    I've problem with deleting draft AP Invoices documents in draft process (Approval
    Procedure). AP Invoce which i want to delete has status "Rejected"
    According to polish help documentation in order to remove such docs i`ve to:
    1) From Menu: Administration >  Approval Procedures > Approval Status Report - Cancel
    an approval procedure, position the cursor on the row of an approval template in the
    report results and choose Cancel from the Data menu.
    2) Now ,theoretically, i should be able to remove unwanted document from Document
    Drafts Report, position the cursor on the row of in the report results and choose
    Remove from the Data menu.
    Unfortunately after pressing 'Update' i recive 2 contradictory messages:
    1) Operation completed successfully  [Message 200-48]
    2) Cannot delete drafts in approval process   [Message 3612-1]
    Any suggestions ?
    Greetings,
    Jedrzej

    Hello Jedrzej,
    In the current definition of B1, draft documents that were rejected during the Approval Process cannot be deleted fro the Document Draft window. This design is to ensure that the audit trail is kept for all the actions performed on the document (creation -> rejection).
    To suppress the display of drafts in the Document Draft window, you may consider the workaround procedures described in Notes 1111431
    and 791704.
    I hope the above helps.
    Regards,
    Lorna Real

  • Bulk Delete Draft AR Invoices

    Our customer has the requirement to be delete hundreds of draft AR invocies that have been created. Not all invoices needs to be deleted, only those with a partocualr product (query which has been generated).
    Is there a way that bulk draft documents can be selected and deleted in bulk (as opposed to opening each draft and deleting each draft one by one?).
    Thanks
    Lisa

    Hi Lisa
    As we can not select draft documents by the item of that document,
    it not likely you request can be done in the standard SBO application.
    However,you can write a simple addon which using oDrafts object to
    select all the draft invoices need to be deleted,and delete them by
    remove method.(oDrafts.remove)
    Regards,
    Syn Qin
    SAP Business One Forums Team

  • Can't delete drafts from Macmail

    I have 29 duplicate, blank drafts in my drafts folder that I am unable to delete. I'm not even sure why these messages were duplicated. I was able to delete the original message, but not these blank ones. When I hit the delete button the headline turns to grey. I have also tried rebuild from the mailbox at the top of the page, but it is grey and won't allow me to do this.
    Thanks for any help.

    I have also experienced this problem - it affects Mail drafts created under Tiger, before upgrade to Leopard. I can suggest two solutions:
    1. Email the drafts to yourself (if only a small number)
    2.
    Close Mail.
    In Finder go to "GO" (drop down bar) menu Click on "HOME" (or shift-command-H)
    Look for the "LIBRARY" folder and Click on it.
    Look for the "MAIL" folder and Click on it.
    Here you will see folders .
    For POP accounts you will see the folders will start with POP-(then your email address with incoming server)
    Select and open the folder
    Select and open Drafts.mbx
    Move all contents of Drafts.mbx) to trash
    (Repeat for other POP account folders)
    Now go back to mail and open mail (the drafts will still be there, minus attachments)
    Select the drafts sub-folder for each POP account (left hand menu)
    Rebuild the folders (Mailbox menu > Rebuild)
    The drafts will now disappear and the folders will empty.
    Drafts created in Leopard are not affected.
    Good luck!

  • Have accidentally deleted draft email and it's not in the trash folder in email or my trash bin. Anything else I can do?

    I have accidentally deleted a draft email. It's not in my trash folder in mail, or the trash bin. Anything elese I can do?

    Mail application?
    Some ideas.
    https://discussions.apple.com/message/12137848#12137848
    If it was on your computer long enough it may be in your backup if you have one.

  • Can't edit connections w/o deleting drafts; can't delete drafts w/o edit connection!

    I'm in a CS3 catch-22! I had Contribute working fine & had 3 drafts I was working on. Web host changed FTP passwords. I go to edit connections and it says "Can't edit without deleting or publishing drafts". When I go to publish, of course I can't because the FTP password is wrong, and I can't delet for the same reason. I tried deleting from Outlook Explorer but there seems to be a problem still -- no drafts show in draft console, but I STILL CAN'T EDIT! HELP!

    Darn, I'm having the same issue now (had to change my FTP password), getting an answer doesn't look too promising either with your posting last May, and no answer.
    here's my question, just in case! http://forums.adobe.com/message/2586986#2586986

  • Zombie deleted draft messages keep coming back in Mail

    I have several messages in my drafts mailbox that just keep coming back. I've deleted them several times over and even rebuilt my mailboxes (ALL of them!) to try and fix this issues. Anyone else seeing this?

    That seems to have solved it. I turned off storing drafts on the server a couple days ago and they haven't come back. Thanks!

  • Anybody having trouble deleting drafts?

    I upgraded to Leopard on the release date and had a few drafts in Mail.app that got carried over. I went to delete one of them tonight and it just keeps popping back to the drafts folder...anybody else having this problem/know how to resolve it? Also, new drafts that I create have the same problem.

    This may be a temporary help for you.
    try sending the e-mails in the drafts to yourself. it worked for me. when they come back to the inbox, just delete them out.

  • ERMS Rule Modeler: Delete draft rules

    Hello,
    I have an urgent query on ERMS rule modeler.
    Once a draft version is created, how can we delete it? I noticed that we can only delete the rules within the Draft rules node but not the node itself.
    This way if you wish to edit the released rules again, it is not possible because it asks to release draft rules first (which you don't want).
    Is there a way to delete the draft version or cancel the changes once draft version is created so that we can edit the released rule?
    Any report or via rule modeler?
    Best Regards,
    Mohit

    Hi Mohit,
    hope I get your question right... but you have a node with released rules and one with draft...Just go to edit modus and delete the whole node...
    Go to edit modus and select the node with Draft rules
    Click on the Bucket and save and there are gone...
    Hope it helps.
    Regards,
    Martin

  • Deleting Draft Messages

    I have a draft message that originally had no addressee that I saved.  However I now cannot delete it.  It keeps reappearing after it seems like I deleted it.  Does anyone know how to correct this issue?

    Have you tried opening the message and then deleting it?

  • IBooks Author - How do I delete drafts I no longer want?

    Trying different things in IBooks Author, I ended up with four versions of the same book (four files). Each has its own template, etc.  I have selected the version I want to keep.  How do I delete the three versions that I do not want?

    You can delete those in the Finder.
    See OS X Lion: About Auto Save and Versions for details on controlling 'versions' as well.

Maybe you are looking for

  • Transfer iTunes play count data from old laptop to new Macbook Pro

    I have just purchased a macbook pro. Previously I had a Dell laptop running Windows 7. I had stored all my music on an external harddrive, I have successfully transferred my music to my new iTunes library. However, all the songs have no plays, is the

  • Thumbnail Pictures

    Hey guys, I am working on recreating a website from frontpage files, and I am on the photo gallery page and I copy the thumbnail photos and paste them into an AP DIV and link them to a higher resolution image. When I preview the site in IE 7 it has t

  • Is it possible to play a DVD in NTSC format on Macbook Air?

    I am ordering a DVD from overseas, however it is only available in NTSC format. The seller advised me that I should be able to watch it on a computer, simply by selecting the correct setting. Is this true?  I am Thank you!

  • Minimize, Maximize and Close buttons are invisible

    I have rather werid problem with Firefox since yesterday. Mainly the three buttons at the top corner are invisible. I can still click on them but I cannot see them, as if they are obscured by upper tab. I tried to launch Firefox in safe mode and I us

  • Peap authententication

    Hi, what does Enable PEAP machine authentication mean on the ACS server ? we are having a training center where we use certificates for any laptop (domain laptops) to join our wireless network. just wondering  is there any possiblitly for any laptop