03-01-2012 07:25 AM
I'm just starting out with the 2011 ACT SDK and struggling to find any COMPLETE C# source code examples. Getting headaches in trying to find out which assemplies to include that will allow me to simple create a new contact. I have the Act. Framework.Interop loaded and can open a Act database usnig the LogOn() method but I can't find the assemply to include that will resolve the Contract Class.
03-01-2012 07:50 AM
03-01-2012 08:46 AM
If you've already added a reference to Act.Framework.dll, then in your project you'll need to add a using statement for Act.Framework.Contacts.
The full examples can be found in within the download the path should be something like: \\Sage ACT! 2012 SDK\Content\Code Samples
03-01-2012 11:58 AM
First, in regards to assemblies for the current version, I usually just make a copy of \\ACTWG\GlobalAssemblyCache and paste the entire folder somewhere near my projects folder so the assemblies are easier to find.
I posted some sample code in this thread that shows how to get the field descriptors for various contact fields. Once you have the DBFieldDescriptor it has a SetValue method you can use.
03-01-2012 07:28 PM
I have found the assemblies needed on the media disk and now can compile without issue.
Didn't see any code examples on this thread and still looking for help in saving an address somewhere for my new contact I just saved.
03-02-2012 07:05 AM
Apologies for not mentioning they would be on the install media previously. I included a link to another thread in my previous post that shows, as I mentioned, how to get a DBFieldDescriptor, once you have this object you can call it's SetValue method to save the data.
Below I show both of the methods for setting the value of a field, to do this for the address field simply swap out the field names I have for TBL_Contact.Business_Line1
Contact c = _ActApp.ApplicationState.CurrentContact; ContactFieldDescriptor customField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("TBL_CONTACT.CUST_SDKTEST_104653792"); ContactFieldDescriptor userField3 = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("TBL_CONTACT.USER3"); int i = 32; customField.SetValue(c, i); c.Fields["TBL_CONTACT.USER3", Act.Framework.MutableEntities.FieldNameType.Real] = "TEST"; c.Update();
03-14-2012 05:47 AM
I am having issues adding the assembly reference. I have added a reference to Act.FrameWork.dll and included "using Act.Framework". The reference seems to add fine, I can view all the framework types and Visual Studio promts when typing.
However when I build the solution I get the error "The type of namesapce act could not be found, are you missing an assembly reference...". Also, if I then try to view the Act.Framework reference in the object view it is not there.