Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3316

How to change the author in a WebI document

$
0
0

Hello Guys,

 

I need to change the author of a document.

 

After some research and checking the JDK I used the code below to update the AUTHOR.

 

 

Code

enterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);

  infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");

  infoStoreStart = (IInfoStore)enterpriseSession.getService("", "InfoStore");

 

 

  IInfoObjects reports = (IInfoObjects)infoStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_CUID LIKE '"+ request.getParameter("SI_CUID") +"'");

  String oldowner = "";

 

 

  for (Object o : reports) {

    IInfoObject iObject = (IInfoObject)o;

    oldowner = (String)iObject.properties().getProperty(CePropertyID.SI_AUTHOR).getValue();

  

    // Change the owner

    iObject.properties().setProperty(CePropertyID.SI_AUTHOR, "Administrator");

    out.print(iObject.getTitle() +" - "+ oldowner +"<br>");

  

  }

 

  out.println("Saving...<br>");

  infoStore.commit(reports);

  out.println("Complete<br>");

 

 

  enterpriseSession.logoff();

 

When I use the Query Builder to capture the information, the SI_AUTHOR property is set to the correct one, but when I open the WebI document the author displayed is the old one.

 

Do you know how do I force to update the document?

 

Thanks a lot in advance!


Viewing all articles
Browse latest Browse all 3316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>