Filter Box added to custom list page

I have a .net class that displays a list of opportunities for all company ids in a list.

This works perfectly.

However, I would like to add the default opportunity filter box to the screen as well. What the heck am I missing? No matter what I try I just get run time errors.

Code below.

Sorry for the poor pasting of code...

public override void BuildContents() { try { GetTabs("Company"); AddContent(HTML.Form());

Record rCompany = FindCurrentRecord("Company");

// custom coding here that builds the string of company ids

List extendedOppoList = new List("OpportunityList");
extendedOppoList.Filter = String.Format("comp_companyid in ({0})", companyids);
extendedOppoList.PadBottom = false;

// how the heck do I get this FilterBox on the screen... EntryGroup object obviously isn't it or I'm not doing it right.
//EntryGroup filterBox = new EntryGroup("OpportunityFilterBox");
AddContent(extendedOppoList);
AddUrlButton("New", "newopportunity.gif", Url("1190"));
} catch (Exception ex) { AddError(ex.ToString()); throw; }

}

  • 0

    Hi

    Use the inbuilt class to add a list page with filter box.

    using System;

    using System.Collections.Generic;

    using System.Text;

    using Sage.CRM.WebObject;

    using Sage.CRM.Wrapper;

    using Sage.CRM.Data;

    using Sage.CRM.Controls;

    namespace Test.DataPages

    {

    public class DutyTypeMasterListPage : ListPage

    {

    public DutyTypeMasterListPage()

    : base("Projects", "ProjectsGrid", "ProjectsFilter")

    {

    FilterByField = "proj_arch";

    FilterByContextId = (int)Sage.KeyList.CompanyId;

    }

    public override void BuildContents()

    {

    try

    {

    /* Add your code here */

    base.BuildContents();

    }

    catch (Exception error)

    {

    this.AddError(error.Message);

    }

    }

    }

    }

    Cheers

    Shezad