Post-action Events
PostActionEvent (Page Specs)
You can also define post-action events in a spec that opens a data form. For example when you create an action on a page to show a data form, you can define a post-action event to go to the Home area. Because page definitions can be edited in Design Mode, these post-actions can be configured from the application or defined on a spec with the SDK. For several post-action types, you can select to also run the RefreshShellNavigation event after the indicated post-action. Types of post-action events include:
GoHome
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and go home">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<GoToPage>
<Home />
</GoToPage>
</PostActionEvent>
</ShowAddDataForm>
</Action>
GoToPreviousPage
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and go to previous page">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<GoToPage>
<PreviousPage />
</GoToPage>
</PostActionEvent>
</ShowAddDataForm>
</Action>
</Actions>
GoToFunctionalArea
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and go to Administration">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<GoToPage>
<FunctionalArea FunctionalAreaID="64bbf407-7062-4f63-bc7c-e947f3eef6aa" />
</GoToPage>
</PostActionEvent>
</ShowAddDataForm>
</Action>
GoToSpecificPage
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and go Constituent Profile page">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<GoToPage>
<SpecificPage PageID="c8b3151b-d53a-4581-af5a-e14ac2ad6307" TabID="00000000-0000-0000-0000-000000000000" SectionID="00000000-0000-0000-0000-000000000000" />
</GoToPage>
</PostActionEvent>
</ShowAddDataForm>
</Action>
RefreshPage
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and refresh page">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<RefreshPage />
</PostActionEvent>
</ShowAddDataForm>
</Action>
RefreshSection
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and refresh section">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<RefreshSection />
</PostActionEvent>
</ShowAddDataForm>
</Action>
CustomSectionMethod
RefreshOtherSections
This is not currently available in Design Mode. An example for this is available in the Kitchen Sink samples.
RefreshShellNavigation
<Action ID="2b8ac3df-0029-4898-a09b-0bdd118443aa" Caption="Add an individual and refresh shell navigation">
<ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434" xmlns="bb_appfx_commontypes">
<PostActionEvent>
<RefreshShellNavigation />
</PostActionEvent>
</ShowAddDataForm>
</Action>
SectionModelAction
Toast
This is not currently available in Design Mode.
<Action ID="776ae8c4-574a-4985-aae2-ca8cd3d6eaf4" Caption="Section action caption" ImageKey="res:newitem">
<common:ShowAddDataForm DataFormID="1986f0cf-efb6-48b3-afde-950b57562434">
<common:PostActionEvent>
<common:Toast Importance="Normal" Message="Test"></common:Toast>
</common:PostActionEvent>
</common:ShowAddDataForm>
</Action>
DataFormPostAction (Data Form Specs)
Add and Edit Data Forms support invoking a block of server-side CLR code after the form has been saved. This code is known as the data form’s internal “post action” and is defined by the DataFormPostAction element in the spec. It executes as part of the data form’s save request (DataFormSave), and is therefore considered an atomic part of the form definition itself.
The DataFormPostAction element refers to a server-side class in the specified assembly that inherits from Blackbaud.AppFx.Server.AppCatalog.AppDataFormPostAction. This base class defines an “Invoke” method that must be supplied by inheritors. When the data form is saved, this method will be called and the class will have access to information about the form save request through the class’s AppDataFormPostActionContext object.
Using this technique allows you to combine the elegance and ease of a standard SP-based implementation with the capabilities of a CLR implementation. As an example, the Infinity platform uses this technique to reset some values that are cached on the web server when a workflow trigger is added or updated.
The following example refers to Custom.AppFx.Example.Catalog.ExampleAction in a DLL called Custom.AppFx.Example.Catalog. Parameters can be declared via a child StaticParameters element. In the example, two parameters are passed for the data form "post action."
<common:DataFormPostAction AssemblyName="Custom.AppFx.Example.Catalog"
ClassName="Custom.AppFx.Example.Catalog.ExampleAction">
<common:StaticParameters>
<common:ParameterList>
<common:Param ID="FIELD1">
<common:Value>Example</common:Value>
</common:Param>
<common:Param ID="FIELD2">
<common:Value>Test</common:Value>
</common:Param>
</common:ParameterList>
</common:StaticParameters>
</common:DataFormPostAction>
A stubbed-out class contained in the catalog project and assembly may look like this:
Imports Blackbaud.AppFx.Server
Public NotInheritable Class ExampleAction
Inherits AppCatalog.AppDataFormPostAction
Public Overrides Sub Invoke()
End Sub
End Class
Note: Errors that occur during the execution of this DataFormPostAction are trapped and logged on the server without causing the save request itself to fail.