Delete document cards from Knowlede Directory

Hi,
I am trying to delete a card from the knowledge directory (document folder) but nothing happens (ie. the card is supposed to get deleted) when I run the following code:
IPTQueryResult qrCards = Folder.QueryCards(PTPROPIDS.PT_PROPID_OBJECTID, true, PT_PROPIDS.PT_PROPID_OBJECTID, 0, -1, null);
for (int i = 0; i < qrCards.RowCount(); i++)
int objectId = qrCards.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);
Object[] status = iptSession.GetCatalog().DeleteCards(objectId);
for (int y=0;y < status.length; y++)
MessageBox.Show("status: " + status[y]);
status returned: -2147024891
Am I missing something?
Thanks in advance.
Edited by: user13371320 on Jan 2, 2011 10:50 PM

If you're connecting to a portal instance with the Portal Server API (as it appears you are), then you should probably be selecting the Portal component in PTSpy. You can tell from the startup which component to select, as it will say something like:
OpenLog: verposity level = 2
OpenLog: Registered application name: ConfigInitialization (local machine only)
OpenLog: Registered application name: portal.[machinename].Administrator (local machine only)
The last application name is what you'd use. Make sure you are recording on the machine running the custom app.
Since you can see it in both browse and edit mode, we know that the search index and the database both know of the card, so it can't be that it thinks the card is missing. At this point, you'd have to go through the PTSpy recorded when you run your app. You should start it right before you initiate the delete, and shut it off after the PTSpy stops recording new lines. You might be able to search for the error code, otherwise you'd have to go line by line to find something related to permissions, though other types of errors (not found, network access problems) might return the access denied message.
-Mike Headley, WCI Developer Support

Similar Messages

  • Anyone knows how to delete a file from a directory?????

    hi there
    anyone has any idea on how to delete a file from a directory? delete(String filename)? thank you.

    Hi,
    Check this link.
    Gives you an example code to show how to delete a file.
    http://examples.oreilly.com/jenut/Delete.java
    Hope this helps.
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • HT201303 how do i delete credit card from account

    how to delete a credit card from the account

    Start iTunes and then go to iTunes Store
    on the bottom there is a link "account" click on that and in there you can see and change information about your account.
    Hope this any help for you.

  • How do I delete a file from a directory

    I want to delete the file I have finished processing in the c:\upload directory but the f.delete() command is not working. Am I using this command correctly?
    The f.delete() is after I copy the file to an archive directory.
    Program:
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    public class ReadSource {
    public static void main(String[] args) throws Exception {
         StringTokenizer st1;
              String val1, val3, val4, val5, val9, val10, val11, val12, val13, val14, val16;
              String val2, val6, val7, val8, val15, val17, val18, val19, val20;
              int cnt;
              File f = new File("C://upload" );
              FileWriter outFile = new FileWriter("C://RIFIS/log/logfile.txt", true);
              String filetext = "Starting RIFIS Upload";
              java.util.Date d = new java.util.Date();
              SimpleDateFormat form = new SimpleDateFormat("dd/MMM/yyyy hh:mm:ss");
              String dateString = form.format(d);
         try {
              Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xxxxx.xxxx.xxx:1521:xx","xxxxxx","xxxx");
                        Statement st = conn.createStatement();
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write(filetext+" - "+dateString);
                        if (f.isDirectory())
                        { String [] s = f.list();
                        for (int i=0; i<s.length; i++)
                        { outFile.write(System.getProperty("line.separator"));
                             outFile.write("Found file - "+f+"/"+s);
              FileReader file = new FileReader(f+"/"+s[i]);
                                  File inputFile = new File(f+"/"+s[i]);
                                  File outputFile = new File("C://RIFIS/archive/"+s[i]);
                        BufferedReader buff = new BufferedReader(file);
                        boolean eof = false;
                        String val0="";
                        ResultSet rec = st.executeQuery("SELECT landings_hold_batch_seq.nextval FROM dual");
                        while(rec.next())
                        { val0 = rec.getString(1); }
                                  cnt=0;
                        while (!eof)
                        { String line = buff.readLine();
                             if (line == null)
                             { eof = true; }
                             else
                             { //System.out.println(line);
                                       cnt = cnt+1;
                                  st1 = new StringTokenizer(line,",");
                                       val1 = st1.nextToken();
                                       val2 = st1.nextToken();
                                       val3 = st1.nextToken();
                                       val4 = st1.nextToken();
                                       val5 = st1.nextToken();
                                       val6 = st1.nextToken();
                                       val7 = st1.nextToken();
                                       val8 = st1.nextToken();
                                       val9 = st1.nextToken();
                                       val10 = st1.nextToken();
                                       val11 = st1.nextToken();
                                       val12 = st1.nextToken();
                                       val13 = st1.nextToken();
                                       val14 = st1.nextToken();
                                       val15 = st1.nextToken();
                                       val16 = st1.nextToken();
                                       val17 = st1.nextToken();
                                            val18 = st1.nextToken();
                                            val19 = st1.nextToken();
                                            val20 = st1.nextToken();
                                       /*System.out.println("Token 0: " + val0);
                                  System.out.println("Token 1: " + val1);
                                  System.out.println("Token 2: " + val2);
                                       System.out.println("Token 3: " + val3);
                                       System.out.println("Token 4: " + val4);
                                       System.out.println("Token 5: " + val5);
                                       System.out.println("Token 6: " + val6);
                                       System.out.println("Token 7: " + val7);
                                       System.out.println("Token 8: " + val8);
                                       System.out.println("Token 9: " + val9);
                                       System.out.println("Token 10: " + val10);
                                       System.out.println("Token 11: " + val11);
                                       System.out.println("Token 12: " + val12);
                                       System.out.println("Token 13: " + val13);
                                       System.out.println("Token 14: " + val14);
                                       System.out.println("Token 15: " + val15);
                                       System.out.println("Token 16: " + val16);
                                       System.out.println("Token 17: " + val17);
                                            System.out.println("Token 18: " + val18);
                                            System.out.println("Token 19: " + val19);
                                            System.out.println("Token 20: " + val20);*/
                                       st.executeUpdate("INSERT INTO LANDINGS_HOLD (lh_id, lh_batch, supplier_dr_id, supplier_unique_id, supplier_dealer_id, supplier_cf_id, supplier_vessel_id, unload_year, unload_month, unload_day, state_code, county_code, port_code, itis_code, market, grade, reported_quantity, unit_measure, dollars, lh_loaddt, lh_loadlive, purch_year, purch_month, purch_day)" +
                        "VALUES (0,'"+val0+"','"+val1+"',"+val2+",'"+val3+"','"+val4+"','"+val5+"',"+val6+","+val7+","+val8+",'"+val9+"','"+val10+"','"+val11+"','"+val12+"','"+val13+"','"+val14+"',"+val15+",'"+val16+"',"+val17+",SYSDATE,NULL,"+val18+","+val19+","+val20+")");
                             FileReader in = new FileReader(inputFile);
                             FileWriter out = new FileWriter(outputFile);
    int c;
                             while ((c = in.read()) != -1)
                             { out.write((char)c); }
                             in.close();
                             out.close();
                             outFile.write(System.getProperty("line.separator"));
                             outFile.write("Number of records inserted - "+cnt);
                             outFile.write(System.getProperty("line.separator"));
                             outFile.write("Copied upload file to archive directory");
                             f.delete(); // delete the upload file
                             outFile.write(System.getProperty("line.separator"));
                             outFile.write(f+"/"+s[i]+" - Has been removed from upload directory");
                             buff.close();
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("Upload Complete...NO ERRORS");
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("*************************************************************");
                        outFile.write(System.getProperty("line.separator"));
                        //outFile.flush();
              //outFile.close();
                        conn.close();
                        else
                        { outFile.write("No files to process"); }
              catch(Exception e)
                   { outFile.write(System.getProperty("line.separator"));
                   outFile.write("ALERT....ALERT....ALERT");
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("Error Occurred in ReadSource.java - RIFIS Upload");
                        outFile.write(System.getProperty("line.separator"));
                   outFile.write("My Error: " + e);
                        outFile.write(System.getProperty("line.separator"));
                        outFile.write("*************************************************************");
                   outFile.flush();
              outFile.close();

    Gave it a try but file c:\upload\DS121002.csv did not go away. Here is the location of my delete command:
    st.executeUpdate("INSERT INTO LANDINGS_HOLD (lh_id, lh_batch, supplier_dr_id, supplier_unique_id, supplier_dealer_id, supplier_cf_id, supplier_vessel_id, unload_year, unload_month, unload_day, state_code, county_code, port_code, itis_code, market, grade, reported_quantity, unit_measure, dollars, lh_loaddt, lh_loadlive, purch_year, purch_month, purch_day)" +
                        "VALUES (0,'"+val0+"','"+val1+"',"+val2+",'"+val3+"','"+val4+"','"+val5+"',"+val6+","+val7+","+val8+",'"+val9+"','"+val10+"','"+val11+"','"+val12+"','"+val13+"','"+val14+"',"+val15+",'"+val16+"',"+val17+",SYSDATE,NULL,"+val18+","+val19+","+val20+")");
                             FileReader in = new FileReader(inputFile);
                             FileWriter out = new FileWriter(outputFile);
    int c;
                             while ((c = in.read()) != -1)
                             { out.write((char)c); }
                             in.close();
                             out.close();
                             inputFile.delete();
                             outFile.write(System.getProperty("line.separator"));
    ............

  • HT201359 What do I do? Can't delete credit card from iTunes and can't update apps

    I'm having problems with deleting my credit card from my iTunes account. Tried everything possible. I tried making a purchase but it didn't go through so now it's not letting me update my apps. What do I do?

    "None" should be located right next to where you chose what kind of credit card you are using. You should be able to find it, if you go to your account and click 'Edit Payment Information' Then where it says what kind of card it is it should be right after PayPal. But if you can't find it, can't you just highlight the information and backspace it?

  • HT5622 How do I delete credit card from my account? I can't seem to remove my payment info?? Help!

    Is there a way to remove/Delete Credit Card/Payment information from an iTunes Account ??

    Some say you can do it by signing into your account on a computer.
    Some say you can't delete.

  • HT2589 How do I delete credit card from my iPad ?

    How do I delete credit card information from iPad?

    Some say you can do it by signing into your account on a computer.
    Some say you can't delete.

  • Remove deleted software components from Integration directory

    Hi,
    I have several software components and products which have been removed from the SLD.
    But I still can see them on the left tree in the integration directory. How can I remove them
    from the tree?
    Thank you!
    Reward points guaranteed

    Hi Michael Schmidt,
    At first delete all the namespaces and imported objects under it :
    1.Delete the created Data Types, Message Types, Message Interfaces, Message Mappings, and Interface Mappings. If there are any errors during activation, try activating the Objects in the manner specified as specified below
    Integration Scenarios
    Actions
    Integration Processes
    Interface Mapping
    Message Mappings
    Message Interfaces
    Message Types
    Data Types
    2.There should be no Imported SAP Objects in the Software Component. If any delete them and activate changes.
    3.Delete all namespaces in the editor using sign. Do not save the changes.
    4.Delete the two default data types that are created in the Interface Objects-->Data Types of the software component version (ExchangeFaultdata, ExchangeLogdata). Now save changes for the s/w component version and activate the changes. Ignore the warnings that pop-up. Your change list should look like the below.
    Then u delete software component by:
    Double Click on Software Component, On Right Hand side >Go to Software Component Version>Delete the software component.
    U can also refer following link:
    /people/siva.maranani/blog/2005/05/22/how-to-delete-software-component-from-integration-builder
    Regards,
    Vinod.

  • Why I can't delete an object from Integration Directory?

    Hi!
    I want to delete one object from ID(Integration Directory) or IR
    (Integration Repository). But the delete button (either the trash can
    or the "delete" menu item) is disabled.
    I get sap_all and all wanted roles. But I still have this issue.
    Please help. Points will be given.

    Lee,
    If you want to delete a namespace you cannot delete until unless all the objects inside the namespace are deleted. If you want to delete any object in ID then right click on it and press Delete.
    Go through this weblog where it shows how to delete namespace:
    /people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi
    ---Satish

  • Had prepaid visa on my account and now want  to use Itunes card and will not work how do you delete visa card from my account

    please help how do you delete visa from my account? I put in Itunes card and it shows my 15.00 credit but cannot download tunes. What do I need to do? I think visa card is issue

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • Delete Credit Card from Sales Order

    Hi Gurus
    I have some issue in releasing sales order to accounting... in this process the only solution I am finding is to delete the credit card info from the sales order. Do we have a BAPI or BDC is the only option.
    Thanks
    Ram Kumar

    Mr,
    1) Delete the Sales Order
    SALESDOCUMENT = <doc. number>.
    ORDER_HEADER_INX-UPDATEFLAG = 'D'.
    2) Delete an item of Sales Order
    SALESDOCUMENT = <doc. number>.
    ORDER_ITEM_IN-ITM_NUMBER = <item number>.
    ORDER_ITEM_INX-ITM_NUMBER = <item number>.
    ORDER_ITEM_INX-UPDATEFLAG = 'D'.
    finally:
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    Amit.

  • HT1918 how can i delete credit card from the itunes store?

    I prefer just to use gifts cards instead of my credit card but itunes wont let me delete my credit card information, and now I cant even redownload applications that i have previously purchased on my ipad. How can I delete and leave my account with no credit card info?

    Moorside01 wrote:
    I have the same issue. My son has an iPod Touch, but it seems that he has to have a credit card associated with the Live ID
    Live ID is for Microsoft.
    Are you saying you do not have the None option when you review his payment info?

  • How can I delete credit card from account to use gift card redeemable credit?

    I cannot use my gift card $20 because my declining credit card refuses my purchase.  I don't want to **** thing to use my credit card, I want to use my redeemable gift card **** it, so why won't it let me.  And I cannot delete my credit card becase there is NO WHERE to get rid of it!!!  Frustrating!!!

    Moorside01 wrote:
    I have the same issue. My son has an iPod Touch, but it seems that he has to have a credit card associated with the Live ID
    Live ID is for Microsoft.
    Are you saying you do not have the None option when you review his payment info?

  • How do i delete Older files from the directory before create a new file?

    Hi,
    How do i delete older files in a particular directory,
    the senorio is count the number of .txt files in a directory and delete the older files if file count is more than 10. (if i add 11th file the very first file has to be deleted)
    i have written the code to count the files and delete , but it is deleting all the files instead of older file
    public class ExtensionFilter implements FilenameFilter {
      private String extension;
      public ExtensionFilter( String extension ) {
        this.extension = extension;            
      public boolean accept(File dir, String name) {
        return (name.endsWith(extension));
    public class FileUtils{
      public static void main(String args[]) throws Exception {
        FileUtils.deleteFiles("c:/countfile/", ".txt");
      public static void deleteFiles( String directory, String extension ) {
        ExtensionFilter filter = new ExtensionFilter(extension);
        File dir = new File(directory);
        String[] list = dir.list(filter);
        File file;
        if (list.length == 0) return;
        for (int i = 0; i < list.length; i++) {
          //file = new File(directory + list);
    file = new File(directory, list[i]);
    if ((list[i]).length()>=10)
         System.out.print(file + " deleted : " + file.delete());
    Thanks,
    Jamin Rosina                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    What your code is doing now, is deleting all filenames that are longer than 10 characters.
    Your problem lies in the line:
    if ((list).length()>=10)

  • How can i delete my card from my account?

    How can i delete her? If i haven't choise as "none"?
    Must i have money on my card, for downloading FREE APPS?

    Create iTune App Store account without credit card to download free Apps.
    http://support.apple.com/kb/ht2534

Maybe you are looking for