10-16-2013 02:47 AM
I am trying to import records via a utility I am creating in C#. I can create the contact record, but I am unable to add an email.
In the following example the line updating the name works, but the command to update the email returns table not found. I am using Sage Act 2011
objContact.Fields["TBL_CONTACT.FULLNAME", Act.Framework.MutableEntities.FieldNameType.Real] = rows["txtForename"] + " " + rows["txtSurname"]; //objContact.Fields["ADDRESS", Act.Framework.MutableEntities.FieldNameType.Alias] = rows["txtEmail"]; objContact.Fields["TBL_CONTACT.EMAIL", Act.Framework.MutableEntities.FieldNameType.Display] = rows["txtEmail"]; objContact.Update();
Thanks
10-16-2013 05:07 AM - edited 10-16-2013 05:07 AM
Act! stores E-Mail addresses in an separate table (TBL_EMAIL)
You also have a mistake in your code: if you give the "fully qualified" field name (TBL_CONTACT.EMAIL) you woul have to set the second parameter to: Act.Framework.MutableEntities.FieldNameType.Real (as you did in your first line)
If you use Act.Framework.MutableEntities.FieldNameType.Display or Act.Framework.MutableEntities.FieldNameType.Alias you would only use the display-name of the field, e.g. "e-mail", "email" or maybe "mail" (don't know the exact name)
In your case this would look something like this:
objContact.Fields["EMAIL", Act.Framework.MutableEntities.FieldNameType.Alias] = rows["txtEmail"];
Or, if using Act.Framework.MutableEntities.FieldNameType.Real:
objContact.Fields["TBL_EMAIL.ADDRESS", Act.Framework.MutableEntities.FieldNameType.Real] = rows["txtEmail"];
10-16-2013 06:25 AM
Hi Thanks for replying
You're right the example I posted has errors in it - but that was the result of me hastily copying and pasting. I already tried those ideas.
I found a solution to this by looping over all the fields in the contact and discovered that the email field is split between BUSINESS_EMAIL and PERSONAL_EMAIL. This is a new database without any alterations so I am sure why this isn't in the SDK. Intuitively I also thought it would be TBL_EMAIL.ADDRESS.
It worked with the following code:
objContact.Fields["TBL_CONTACT.BUSINESS_EMAIL", Act.Framework.MutableEntities.FieldNameType.Real] = rows["txtEmail"];
10-16-2013 08:36 AM