Context

When it comes time to use a task to display a page, your task may need to provide context to that spec. Page actions typically use the page context (the ID for the record that the page displays) to perform their actions. In the example above, the ID from the CONSTITUENT table that corresponds to Robert Hernandez is used in the page actions. The ContextRecordType attribute specifies the type of record that is allowed to be "passed" to the page.

For an example of context, let's look at the Widget page that displays a widget's data. When we view the Widget page, we have to provide the page with the ID of the widget we need Infinity to display. Since the Widget page is used to manage widgets, the context is "Widget." If we view the XML for the PageDefinitionSpec element, we see the ContextRecordType attribute:

<PageDefinitionSpec 
	XMLns="bb_appfx_pagedefinition" 
    	XMLns:common="bb_appfx_commontypes"
    	ID="e2a96b12-1bff-4ef4-8866-d75b2264afdb"
    	Name="Widget Page"
    	Description="Displays information about the given widget."
    	Author="SDK Author"
ContextRecordType="Widget"	
	ExpressionDataFormID="b21b041a-a5e1-4a23-b10c-c56d79c2a6fb”>

Example: The ContextRecordType Attribute for a Page Spec

This means that if we want to display this page, we need to provide the page with the ID of a widget.