|
Guides (SDK /API) | Technical Reference | BBDN | How-to Documentation |
Open CustomPledgeFormDisplay.ascx for editing in Designer.
Double-click the Pledge button. CustomPledgeFormDisplay.ascx.vb appears in the editor with a newly added handler for clicking the button. The new Sub procedure should look like this:
Protected Sub ButtonPledge_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonPledge.Click End Sub
Create a Sub procedure to write a CustomPledgeRecord.
Private Sub AddCustomPledgeRecord() End Sub
Using the BBMetalWeb generated classes, create an object to hold the form data.
Dim CustomPledgeData As New PartsProjectExample.AddForms.CustomPledge.CustomPledgeRecordAddDataFormData()
Load default values into the form data.
CustomPledgeData = PartsProjectExample.AddForms.CustomPledge.CustomPledgeRecordAddDataForm.LoadData(Me.API.AppFxWebServiceProvider)
Populate the object with form data.
CustomPledgeData.AMOUNT = TextBoxAmount.Text If Not API.Users.CurrentUser.IsAnonymous Then CustomPledgeData.CONSTITUENTID = API.Users.CurrentUser.BackOfficeGuid End If CustomPledgeData.EMAIL = TextBoxEmail.Text CustomPledgeData.FIRSTNAME = TextBoxFirst.Text CustomPledgeData.KEYNAME = TextBoxLast.Text CustomPledgeData.MIDDLENAME = TextBoxMiddle.Text
Using BBMetalWeb generated classes and the BBIS connection to the web service, create the load request for the Add Data Form.
CustomPledgeData.Save(Me.API.AppFxWebServiceProvider)
Call AddCustomPledgeRecord() from the button handler based on the conditions of the design. For now, call AddCustomPledgeRecord in any case.
If MyContent.OnlyWriteToCustomPledgeRecord Then AddCustomPledgeRecord() ElseIf API.Users.CurrentUser.IsAnonymous Then AddCustomPledgeRecord() End If