Community
Showing results for 
Search instead for 
Do you mean 
Reply

Very first step to start with the SDK

Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

I can't figure this out:

 

static void Main(string[] args)

{

ActFramework actFwk = new ActFramework();

try

{

actFwk.LogOn(@"C:\Users\Public\Documents\ACT\ACT Data\Databases\ACT2015Demo.PAD", "Chris Huffman", "");

ContactList lstContacts = actFwk.Contacts.GetContacts(new Act.Shared.Collections.SortCriteria[] { });

//Console.WriteLine("This database has " + lstContacts.Count + " Contacts.");

// Do other stuff

}

catch (LockedDatabaseException ex)

{

// Database is locked. Unable to logon.

Console.WriteLine("Locked Database: ", ex.Message);

}

catch (Exception ex)

{

// Failed to log on. Wrong username/pass/PAD file, of other error.

Console.WriteLine("Exception: " + ex.Message);

}

}

 

 

This line from above:

ContactList lstContacts = actFwk.Contacts.GetContacts(new Act.Shared.Collections.SortCriteria[] { });

 

The first entity - ContactList - it does not like.  I can't figure out what it is supposed to be.

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com
Highlighted
Nickel Contributor
Posts: 175
Country: USA

Re: Very first step to start with the SDK

Without knowing what namespaces you have set up with Using statements above the code you posted, it looks like "ContactList" should be replaced with "Act.Framework.Contacts.ContactList"
Highlighted
Bronze Super Contributor
Posts: 1,284
Country: USA

Re: Very first step to start with the SDK

When you say "it does not like" what do you mena?

 

Does this line throw an error? Can you post the error.

 

 

Thanks

-- Jim Durkin

Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Act.Framework;

using Act.Shared.Collections;

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com
Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

namespace SDKConsole2

{

class Program

{

static void Main(string[] args)

{

ActFramework actFwk = new ActFramework();

try

{

actFwk.LogOn(@"C:\Users\Public\Documents\ACT\ACT Data\Databases\ACT2015Demo.PAD", "Chris Huffman", "");

ContactList lstContacts = actFwk.Contacts.GetContacts(new Act.Shared.Collections.SortCriteria[] { });

//Console.WriteLine("This database has " + lstContacts.Count + " Contacts.");

// Do other stuff

}

catch (LockedDatabaseException ex)

{

// Database is locked. Unable to logon.

Console.WriteLine("Locked Database: ", ex.Message);

}

catch (Exception ex)

{

// Failed to log on. Wrong username/pass/PAD file, of other error.

Console.WriteLine("Exception: " + ex.Message);

}

}

}

}

 

ContactList has a red squigly line under it.  The error says:  "The type or namespace name 'ConactList' cound not be found (are you missing a using directive or an assembly reference?)"

 

 

 

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com
Highlighted
Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Very first step to start with the SDK

You need to add

 

using Act.Framework.Contacts;

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

Thanks vivek!   That was it.  I would have thought that Act.Framework would cover anything under that library, eg-Act.Framework.Contact. 

 

Is there a way to see what all the libraries contain?  An object browser of some sort?

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com
Highlighted
Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Very first step to start with the SDK

Haha, yeah it's called the Object Browser funnily enough. View->Object Browser or Ctrl+Alt+J
Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

clever.

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com
Highlighted
Loyal Listener
Posts: 51
Country: USA

Re: Very first step to start with the SDK

Thanks for all you help!  It got me over a hump.  Now I need to figure out something to do with what I know (just to see if I can). 

 

I can connect to the database with a console application.  What do you recommend for the next step up the learning curve?

Kevin Varnon
ClientTrax CRM
Kansas City
(785) 408-3702
kevin@clienttrax.com