" /> Create Agentgroup with Genesys SDK - Genesys CTI User Forum

Author Topic: Create Agentgroup with Genesys SDK  (Read 1468 times)

Offline carpio

  • Newbie
  • *
  • Posts: 34
  • Karma: 0
Create Agentgroup with Genesys SDK
« on: September 25, 2017, 07:20:05 AM »
Advertisement
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

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: Create Agentgroup with Genesys SDK
« Reply #1 on: September 25, 2017, 08:12:10 AM »
Hi,

Try this code:

                  [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();[/code]

Offline carpio

  • Newbie
  • *
  • Posts: 34
  • Karma: 0
Re: Create Agentgroup with Genesys SDK
« Reply #2 on: September 25, 2017, 12:04:31 PM »
super this works!!!

Thanks you!!!!