Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Best archive to get Assoiates with email address

Which archive should I use to get Associates Login name, first name, last name and email address? I seems like email address is missing from all the user archives...

Should I make an extra look-up or use the person archive. 

If person archive is the way to go, how should I filter to get only associates.

 

/ Peter

RE: Best archive to get Assoiates with email address

Hi Peter,

Archive providers are primarily used to populate archive controls (multi-column lists), and not intended to exposed infinite join possibilities to aggregate all possible related information.

User providers expose information required to configure user settings in Admin, or Settings and Maintenance, not person properties such as email addresses.

When you needed related information, you will need to aggregate that information.

When existing providers don't expose all the fields needed, construct the query and joins yourself using the DotSyntax ("Dynamic") provider.

Best regards.

 

Af: Tony Yates 7. aug 2017

RE: Best archive to get Assoiates with email address

I expect Tony is right but you say little about what it is you need to achieve.

> If person archive is the way to go, how should I filter to get only associates.

Using the person provider you could try with:

personAssociate/assocType equals 0

Get hold of Marek's ArchiveBrowser to experiment with any provider..
Conrad

Af: Conrad Weyns 7. aug 2017

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!

Af: Tony Yates 8. aug 2017

RE: Best archive to get Assoiates with email address

Thanks Tony,

The "(email->person_id)" syntax was just what I was looking for.

/ Peter

Af: Peter Borg 12. aug 2017

RE: Best archive to get Assoiates with email address

Thank you Tony,

I was searching for this answer for last few days. :)

Af: Ruban Joshva 10. nov 2017