RE: Best archive to get Assoiates with email address
Hi Peter,
Here is an example how to get the information you want via the dotsyntax "Dynamic" provider:
using (FindAgent fa = new FindAgent())
{
string[] columns = {
"associate.associate_id",
"associate.person_id",
"associate:person_id.firstname",
"associate:person_id.lastname",
"associate.person_id.(email->person_id).email_address",
"associate.person_id.(email->person_id).email_id"
};
ArchiveRestrictionInfo[] restrictions =
{
new ArchiveRestrictionInfo()
{
Name = "associate.type",
Operator = "=", Values = new [] {"0"},
IsActive = true
}
};
var results = fa.FindFromRestrictionsColumns(restrictions, "Dynamic", columns, int.MaxValue, 0);
if (results != null && results.ArchiveRows != null && results.ArchiveRows.Length > 0)
{
int count = results.ArchiveRows.Length;
Debug.WriteLine("Total Records: ", count.ToString());
foreach (var rowItem in results.ArchiveRows)
{
Debug.WriteLine("********************************************************");
Array.ForEach(columns, (s) => Debug.WriteLine("{0}: {1}",
s, rowItem.ColumnData[s].DisplayValue));
}
}
}
Hope this helps!