Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: carpio on August 15, 2018, 02:56:04 PM

Title: Create Folder type Site
Post by: carpio on August 15, 2018, 02:56:04 PM
I'm trying to create a folder of type Site but get the error "No Permission to create object under this folder)

Here my test code:

CfgFolder folder = new CfgFolder(service);
folder.Name = "TEST";
folder.FolderClass = CfgFolderClass.CFGFCSite;
folder.Type = (CfgObjectType)22;
folder.OwnerID.DBID = ten.DBID;
folder.Save();


What am I missing?
Title: Re: Create Folder type Site
Post by: cavagnaro on August 15, 2018, 04:04:27 PM
The user you are using has no perm to create objects on that folder. Check it via CME first

Enviado de meu E6633 usando o Tapatalk

Title: Re: Create Folder type Site
Post by: carpio on August 15, 2018, 08:41:02 PM
Created a folder with my user in cme and it worked.
Did this first to make sure I use the correct values to create a site.
Title: Re: Create Folder type Site
Post by: terry on August 15, 2018, 09:57:13 PM
Shouldn't you also provide owner type and also may be parent's object type and DBID?
Title: Re: Create Folder type Site
Post by: carpio on August 16, 2018, 01:00:26 PM
For folders on top layer i usually never set the owner or parent.
I have tried to set this for the site folder but also no result.
I have tried to set the owner to tenant.
Title: Re: Create Folder type Site
Post by: cavagnaro on August 16, 2018, 01:08:36 PM
What does CfgServer logs say?
Try to compare a CME call VS yours


Enviado de meu E6633 usando o Tapatalk

Title: Re: Create Folder type Site
Post by: carpio on August 17, 2018, 08:42:13 AM
I have compared the logs and saw that when i create a site folder in cme i have a ownerid
<CfgFolder
  DBID="0"
  name="TEST_CME"
  type="22"
  state="1"
  folderClass="2">
<ownerID>
  <CfgTenantOwnerShortcut
    linkDBID="1"  />
</ownerID>
<userProperties />
</CfgFolder>

Im now trying to set the owner id but i get always a error"object reference not set to an instance of an object"
my OwnerId is also null.

here is the code i try:

CfgFolder folder = new CfgFolder(func.app_service);
            folder.Name = "TEST";
            folder.FolderClass = CfgFolderClass.CFGFCSite;
            folder.Type = (CfgObjectType)22;
            folder.OwnerID.DBID = func.app_tenant.DBID;
            folder.Save();



Title: Re: Create Folder type Site
Post by: seaofwires on December 04, 2018, 07:09:32 PM
Posting this here for anyone else that runs into this problem.  I was able to fix the issue by assigning the folder.folderID value to the parent folder's DBID that I wanted to create the folder under. 
Title: Re: Create Folder type Site
Post by: carpio on March 05, 2019, 12:05:26 PM
I have tried to set the folder id to the tenant but get a Exception that a required attribute was still missing.

CfgFolder site = new CfgFolder(service);
                site.Name = "Test";
                site.Type = CfgObjectType.CFGFolder;
                site.FolderClass = CfgFolderClass.CFGFCSite;
                site.FolderId = WellKnownDbids.EnvironmentDbid;
                site.Save();

Do I miss here something?
Title: Re: Create Folder type Site
Post by: cavagnaro on March 05, 2019, 12:41:06 PM
? Have you read the post above yours?

Enviado de meu SM-G9650 usando o Tapatalk