cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the date in SI_UPDATE_TS using java SDK

Former Member
0 Kudos

Hi,

I want to change the date of SI_UPDATE_TS based on each ReportId using Java SDK.

I tried the below code,date is not updating.Please anyone give me the correct code to update the date.

IEnterpriseSession enterprisesession=null;

IInfoStore infostore;

IInfoObjects boInfoObjects=null;


String destDate="1/11/16 11:40:30 PM";


enterprisesession =CrystalEnterprise.getSessionMgr().logon(username,Password,cmsname,authType);

infostore=(IInfoStore)enterprisesession.getService("","Infostore");


int max_id=0;

int docID=670223;


boInfoObjects=(IInfoObjects)infostore.query("Select * from ci_infoobjects where si_kind='WEBI' and si_id="+docID+" ORDER BY SI_ID ASC");


for(Iterator boCount=boInfoObjects.iterator();boCount.hasNext())

IInfoObject boObject=(IInfoObject)boCount.next();


boObject.properties().setProperty("SI_UPDATE_TS",destDate);

System.out.Println("Update date:"+boObject.properties().getProperty("SI_UPDATE_TS").getValue());

max_id=boObject.getID();


infoStore.commit(boInfoObjects);

System.Out.Println("Completed');




Regards,

Kavitha S

Accepted Solutions (0)

Answers (2)

Answers (2)

Joe_Peters
Active Contributor
0 Kudos

Only way I know of to do this is to export the objects to a BIAR file, rename the file to .zip, unzip it, extract BusinessObjects.xml, change the date/time for the object, re-zip it, rename it back to BIAR, and finally import the BIAR.

Joe

Former Member
0 Kudos

The SI_UPDATE_TS property bag holds the time when the object was last updated. Therefore I do not understand the purpose of updating this property.


However, if through your code, you update the property bag, then while performing a commit on the infoobject, the operation would mean an update to the infoobject, thus this property would take the current system time rather than the time you are setting.

Hope I was clear.

Thanks,

Prithvi