Find a project, returning the name
Some tooltip text!
• 1 minute to read
• 1 minute to read
This example saves the criteria under a particular user and then executes the find using the saved restriction.
using SuperOffice;
using SuperOffice.CRM.Services;
using SuperOffice.CRM.ArchiveLists;
using(SoSession.Authenticate( "SAL1", "" ))
{
using(FindAgent agent = new FindAgent())
{
ArchiveRestrictionInfo[] restrictions = new ArchiveRestrictionInfo[1];
restrictions[0] = new ArchiveRestrictionInfo( "name", "begins", "b" );
agent.SaveRestrictionsAndGetCriteriaInformation( "Criteria", "findproject", "associate=1234", restrictions, new string[1] { "name" } );
ArchiveRestrictionInfo[] indirect = new ArchiveRestrictionInfo[1];
indirect[0] = new ArchiveRestrictionInfo( "criteriaAssociate", "=", "1234" );
FindResults result = agent.FindFromRestrictions( indirect, "findproject", 50, 0 );
DumpResult( result.ArchiveColumns, result.ArchiveRows );
}
}
Note
DumpResult() is a private helper method that you can easily add to your code.