Create Agentgroup with Genesys SDK

Hello,

I want to create a Agent group with the SDK but somehow it is not working and I can’t find the mistake.
The ConfServerProtocol and ConServiceFactory are setup and working fine. Already created Person, skills and virtual queues but The agentgroup will not work.

Here is my Code:

CfgAgentGroup ag = new CfgAgentGroup(service);
ag.GroupInfo.Name = “Group”;
ag.Save();

If I run this code I get an exception : " Object Reference not set to an instance of an object".

Can somone explain what I#m doing wrong?

regards

Hi,

Try this code:

 
                    CfgTenantQuery qTenant = new CfgTenantQuery();
                    qTenant.Dbid = 1;
                    CfgTenant tenant = confService.RetrieveObject<CfgTenant>(qTenant);

                    CfgAgentGroup ag = new CfgAgentGroup(confService);
                    ag.GroupInfo = new CfgGroup(confService, tenant);
                    ag.GroupInfo.Name = "TestGroup";
                    ag.GroupInfo.Tenant = tenant;

                    ag.Save();

super this works!!!

Thanks you!!!