Author Topic: PSDK: CfgFolderQuery return multiple folder  (Read 2077 times)

Offline nuttakorn

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
PSDK: CfgFolderQuery return multiple folder
« on: December 15, 2021, 05:45:31 PM »
I would like to query "Agent" folder under person type as code below:

Code: [Select]
CfgFolderQuery qfolder = new CfgFolderQuery();
qfolder.Name = "Agent";
qfolder.Type = (Int32)CfgObjectType.CFGPerson;
qfolder.OwnerDbid = 1;
CfgFolder folder = service.RetrieveObject<CfgFolder>(qfolder);

However, "Agent" is under multiple group
 
Folder
TEAM A
 --> Agent
TEAM B
 --> Agent

Database also return nothing different except dbid.
Quote
dbid   name   type   owner_dbid owner_type state csid owner_csid description folder_class custom_type
626   Agent   3         1           7         1     0              0           NULL       1                   0
892   Agent   3         1           7         1     0              0           NULL       1                   0

There are any way to query specific folder under "TEAM A" ?
I don't want to use dbid because admin can add TEAM C, TEAM D and so on that I must create mapping file to map between folder and dbid everytime when they have new folder

Thanks in advance.