Table of Contents

Class ListPage

Namespace
Sage.CRM.WebObject
Assembly
SageCRMNet.dll

Used to create a page with a list and associated filter box.
Set the appropriate properties to specify the list and filter box to use.
Add SQL to filter by the current entity, e.g. all records for current company/user etc. Can add New Button(s) to the page (depending on workflow).

public class ListPage : Web
Inheritance
ListPage
Inherited Members

Constructors

ListPage(string, string, string)

Initializes a new instance of ListPage

public ListPage(string entityName, string listName, string filterBoxName)

Parameters

entityName string

Metadata Entity Name.

listName string

Metadata List Name.

filterBoxName string

Metadata Filter Screen.

Properties

DeleteSql

A string that holds the extra SQL clause to filter out deleted records on standard CRM tables. If the EntityName property is set on the ListPage then DeleteSql is automatically configured within the PreBuildContents method to be "xxx_deleted IS NULL" and this clause is added on to the SQL when selecting records to display in the list. To override this behaviour, reset DeleteSql to blank or another clause at the start of a customized BuildContents().

public string DeleteSql { get; set; }

Property Value

string

FilterBoxName

The name of the EntryGroup to be used as the filter box. This should be a search EntryGroup.

public string FilterBoxName { get; set; }

Property Value

string

FilterByContextId

Property used to set a context filter. FilterByField

public int FilterByContextId { get; set; }

Property Value

int

FilterByField

Use this property to add one filter column. The property FilterByContextId will be necessary

public string FilterByField { get; set; }

Property Value

string

Examples

The following is an example of how to use the FilterByField property:

FilterByField = "pers_PesonID";
FilterByContextId = (int)Sage.KeyList.PersonId;

FilterScreen

Gets the current Filter Screen.

public EntryGroup FilterScreen { get; }

Property Value

EntryGroup

ListName

Specifies the grid that is used to display the records.

public string ListName { get; set; }

Property Value

string

ResultsGrid

Gets the current List Grid.

public List ResultsGrid { get; }

Property Value

List

SearchScreen

Obsolete FilterScreen should be used instead.

[Obsolete("Use the property FilterScreen")]
public EntryGroup SearchScreen { get; set; }

Property Value

EntryGroup

Remarks

The set option to this property isn't implemented.

UseEntityTabs

In the base BuildContents functions you can control what tabs are drawn. Set this to true if you want to use EntityName on get tabs function. The default value for this property is false.

public bool UseEntityTabs { get; set; }

Property Value

bool

UseTabs

In the base BuildContents functions you can control whether tabs are drawn or not. Set this to false if you don't want tabs on the page, default is true.

public bool UseTabs { get; set; }

Property Value

bool

UseWorkflow

Obsolete This property will not change the class behavior. The Workflow should be set on DataPage.

[Obsolete("This property will not change the class behavior")]
public bool UseWorkflow { get; set; }

Property Value

bool

Methods

AddNewButton()

Method that adds the New button or buttons to the List page.
A default New button is added that assumes a "RunDataPageNew" method within the same .NET dll. Note that a New button will always added on ListPage.BuildContents if the User has rights to insert into the current entity.

public virtual void AddNewButton()

Examples

The following is an example of how to override the AddNewButton type:

public override void AddNewButton()
{
// Check the user permission and add a button
if (CurrentUser.HasRights(Sage.PermissionType.Insert, EntityName))
AddUrlButton("New", "new.gif", sUrl);
}

BuildContents()

This is the main control method for the ListPage. It adds the tabs, and the <FORM> tag, draws the EntryGroup and the list and the buttons. Override this to change the behaviour.

public override void BuildContents()

PreBuildContents()

Obsolete, use the constructor instead to override this method.

[Obsolete("This method isn't necessary when use the constructor ListPage(entityName,listName,filterBoxName)")]
public override void PreBuildContents()