I try to update a person but get the message that the object is already saved.
Actualy I want to move the person to a different folder.
Code:
var folder = func.folder_query(“disabled”, 3);
var person = func.person_query(textBox_username.Text);
person.SingleOrDefault().FolderId = folder.DBID;<-- here I get the error message tha tobject can#t be saved
person.SingleOrDefault().Refresh(); ← Here I tried also save
I have changed my code to make it a bit more visible
CfgPersonQuery pquery = new CfgPersonQuery(func.app_service);
pquery.UserName = "testagent";
ICollection<CfgPerson> person = pquery.Execute();
person.SingleOrDefault().FolderId = 191;
At person.SingleOrDefault().FolderId = 191; I get the exception that object is already saved.
So I’m trying to change the Object unless I have to change a differnt object then CfgPerson.
But there I do not know where to start.
There is a table cfg_obj_folder with the info of the folder and the objects but I do not now how to update this with the PSDK.
I reviewed my code and checked it and tried some things and came across to this:
CfgPersonQuery qPerson = new CfgPersonQuery();
qPerson.UserName = "testagent";
CfgPerson myPerson = func.app_service.RetrieveObject<CfgPerson>(qPerson);
CfgObjectID obj = new CfgObjectID(func.app_service, myPerson);
CfgFolderQuery q = new CfgFolderQuery(func.app_service);
q.Name = "disabled";
var res = q.Execute();
res.SingleOrDefault().ObjectIDs = <== Here I have to get the ObjectID but which one?
I get this error message when tring to set the object ID
Severity Code Description Project File Line Column Category Suppression State
Error CS0029 Cannot implicitly convert type ‘int’ to ‘System.Collections.Generic.ICollection<Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgObjectID>’ GenesysTool C:\Users\Rene\Documents\Visual Studio 2015\Projects\GenesysTool\GenesysTool\Form_Disable_Users.cs 58 47 Compiler Active
Hi,
i have tried to adapt this code for move some places to specific folder.
I’ve retrieved the folderdbid and placedbid but last step for move object to destination folder doesn’t work.