Context

When it comes time to use a task to display a page, data form, Add Data Form, execute a record operation your task may need to provide context to that spec. For example of context, let's look at the Constituent page that displays constituent data. When we view the Constituent page, we provide the page with the ID of the constituent we need Infinity to display. Since the Constituent page manages constituents, the context is "Constituent." If we view the XML for the Constituent page, we can see the ContextRecordType attribute within the PageDefinitionSpec top-level element:

So when ContextRecordType is included in a PageDefinitionSpec, the page expects some sort of context. The context value typically takes the form of a GUID. In the case of the Constituent page, it expects the ID that uniquely identifies a constituent in the database.

Warning: The value of the ContextRecordType should match the value of the Name attribute within the corresponding Table Spec. If you open the Table Spec for the CONSTITUENT table, you will find that its Name attribute is equal to "Constituent."

OK, we now know that if a page contains a ContextRecordType, then that page expects some sort of context. To utilize that page, such as from a task, we need a way to provide context to that page. Tasks enable you to send or output a context ID to a spec that "consumes" the context, such as our Constituent PageDefinitionSpec above.

Warning: Some specs, such as a Task Spec, send a context ID to other specs that consume the context ID, such as Page Spec or an Edit Data Form.