A component to add a filterbox to the Company PeopleList

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

A component to add a filterbox to the Company PeopleList

  • Comments 2
  • Likes

A new component has been added to the Example Components & Developer Resources (All Versions) download section.  The new component is a rebuild of the PeopleList system action that provides the returned data for the Person tab under the company context.

The C# code used to create the page is shown below.

using Sage.CRM.WebObject;

namespace SagePeopleList
{
public class PeopleList : ListPage
{
/* Constructor needs EntityName, ListName, IdField, FilterByField, FilterContext and ScreenName
*/
public PeopleList()
: base("Person", "PersonList", "PersonFilterBox")
{
FilterByField = "pers_companyid";
FilterByContextId = (int)Sage.KeyList.CompanyId;
}

public override void AddNewButton()
{
AddUrlButton("NewPerson", "new.png", Url("1202"));
}
public override void BuildContents()
{
base.BuildContents();
string strHelpFile = "//Main%20Menu/Content/User/AI_AddingNewPersonToExis.htm?cshid=User%2FAI_AddingNewPersonToExis.htm";
AddHelpButton(strHelpFile);
}
}

}

The important things to note are

  • The use of the new PersonFilterBox in the constructor and the link to the company context.
  • The recreation of the New Person button to ensure the New button behaves correctly.
  • The recreation of the Help button to point to the correct online user help file.
Comments
  • Hi Jeff,

    This is great to show active people only.

    Thanks!

  • This is a great add-on. Has anyone ever noticed that if you try to 'Sort By' a different field you get the error "DotNetBuildError"