Class ListPage
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
stringMetadata Entity Name.
listName
stringMetadata List Name.
filterBoxName
stringMetadata 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
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
FilterByContextId
Property used to set a context filter. FilterByField
public int FilterByContextId { get; set; }
Property Value
FilterByField
Use this property to add one filter column.
FilterByContextId
will be necessary
public string FilterByField { get; set; }
Property Value
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
ListName
Specifies the grid that is used to display the records.
public string ListName { get; set; }
Property Value
ResultsGrid
Gets the current List Grid.
public List ResultsGrid { get; }
Property Value
SearchScreen
Obsolete FilterScreen should be used instead.
[Obsolete("Use the property FilterScreen")]
public EntryGroup SearchScreen { get; set; }
Property Value
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
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
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
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()