Deleting Objects


Deleting objects is much like creating them. The InfoStore must be queried and multiple objects (often just one) retrieved. The collection of InfoObjects is iterated or accessed using the collection's get(index number) accessor method. Then, the collection's delete(IInfoObject) method is called and, finally, the entire collection is committed.

The following function deletes a specific recurring job (or subscription) for a specific user. Supplying the user ID is optional in this case.

[View full width]

public static void deleteRecurringSchedule(IInfoStore iStore,int userID, int scheduleID) throws SDKException { String queryString = "SELECT * " + " FROM CI_INFOOBJECTS WHERE SI_OWNER AND SI_RECURRING=1 "+ " AND SI_ID="+scheduleID; IInfoObjects scheds = iStore.query(queryString); if (scheds.size()==1){ IInfoObject sched=(IInfoObject)scheds.get(0); scheds.delete(sched); } iStore.commit(scheds); }





Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net