Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Updating folder creates new object - Why?

Hi,

I'm writing some code to modify the description of a folder. Every time the folder is updated, a new object is being created. Can someone tell me why this is happening?

var infoStore = BOWrapper.InfoStore;

var query = new StringBuilder("SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='Folder' AND SI_ID=").Append(folder.Id);

InfoObjects infoObjects = infoStore.Query(query.ToString());

InfoObject infoObject = infoObjects[1];

PluginManager pluginManager = infoStore.PluginManager;

PluginInfo pluginInfo = pluginManager.GetPluginInfo("CrystalEnterprise.Folder");

infoObjects.Add(pluginInfo);

infoObject.Title = folder.Title;

infoObject.Description = folder.Description;

infoStore.Commit(infoObjects);

This also happens when I update a user. Is it something to do with the infoStore.Commit(infoObjects) statement?

Thanks

James

Former Member
replied

Something like:

InfoObjects infoObjects = infoStore.Query(query.ToString());

InfoObject infoObject = infoObjects[1];

infoObject.Title = folder.Title;

infoObject.Description = folder.Description;

infoStore.Commit(infoObjects);

Jason

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question