Mixing the Specialised ListPage class with an EntryGroup

Less than one minute read time.

Below is a screen shot of a list page summary page that mixes in a summary block (EntryGroup) at the top.

The page has a filter box and supports paging of the list.

Below is the C# code used.


using System.Collections.Generic;
using System.Text;
using Sage.CRM.WebObject;
using Sage.CRM.Controls;
using Sage.CRM.Data;
 
namespace CompoundListPage
{
    public class OppoList : ListPage
    {
        /* Constructor needs EntityName, ListName, IdField, FilterByField, FilterContext and ScreenName 
        */
        public OppoList()
            : base("opportunity", "opportunitylist", "opportunityfilterbox")
        {
            FilterByField = "oppo_primarycompanyid";
            FilterByContextId = (int)Sage.KeyList.CompanyId;         
        }
 
        public override void BuildContents()
        {
            Record mycompany = FindRecord("company", GetContextInfo("company"));
            EntryGroup myscreen = new EntryGroup("companyboxshort");
            myscreen.GetHtmlInViewMode(mycompany);
            myscreen.TitleURL = Url("200");
            myscreen.Title = Metadata.GetTranslation("tabnames", "company");
            AddContent(myscreen);
 
            base.BuildContents();
        }
    }
}