Skip to Content
0
Former Member
Jun 06, 2011 at 09:17 PM

Updating folder creates new object - Why?

44 Views

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