As of April 17, 2018, this site is now in read-only mode. To start new Blackbaud Developer’s discussions, you will find Developer Discussions in the Blackbaud CRM Community.
To post or respond to Blackbaud Community discussions, you will have to login using a www.blackbaud.com login. Learn how to login here. If you have questions or need assistance, please email firstname.lastname@example.org.
I have a custom tribute add form that serves as an intermediary between a web form and CRM. The purpose is to display tribute pertinent information collected online so that our users can search for existing tributes to make the determination if a new tribute is needed. If a new tribute needs to be created, the process is completely straight forward: new tribute is created, tributee is selected from a search list, and acknowledgees/letters are inserted manually into a collection field. The problem comes when selecting an existing tribute. I have created a value changed method for the Tribute ID where, once the value is changed, I'm trying to call a datalist to load the acknowledgee/letter collection field, and a simple data list to load the tributee from the existing tribute. The code is as follows:
Private Sub _tributeID_ValueChanged(ByVal sender As Object, ByVal e As Blackbaud.AppFx.UIModeling.Core.ValueChangedEventArgs) Handles _tributeid.ValueChanged
Me.TRIBUTEE.Value = Nothing
Dim trib = _tributeid.Value
Private Sub ResetTributeAcknowledgee(ByVal trib As Guid)
Dim AckReq As New DataListLoadRequest
AckReq.DataListID = New Guid("7c8b3f7c-bb7e-455c-a087-2d975a35b8ba")
AckReq.Parameters = New DataFormItem
Dim AckSvc = New AppFxWebService(Me.GetRequestContext())
Dim AckReply = AckSvc.DataListLoad(AckReq)
If AckReply IsNot Nothing Then
For Each item In AckReply.Rows
Dim TribAck = Me.TRIBUTEACKNOWLEDGEE.Value.AddNew()
TribAck.ID.Value = New Guid(item.Values(0))
TribAck.CONSTITUENTID.Value = New Guid(item.Values(2))
TribAck.TRIBUTELETTERCODEID.Value = New Guid(item.Values(5))
Private Sub ResetTributee(ByVal trib As Guid)
Dim TribReq As New SimpleDataListLoadRequest
TribReq.DataListID = New Guid("b84fd53f-a5dd-4012-8557-ecd49aced2f9")
TribReq.Parameters = New DataFormItem
Dim TribSvc = New AppFxWebService(Me.GetRequestContext())
Dim TribReply = TribSvc.SimpleDataListLoad(TribReq)
If TribReply IsNot Nothing Then
For Each item In TribReply.Rows
Me.TRIBUTEE.Value = New Guid(item.Value)
When I build this, then try to run through the process, I get the error: "You must specify a valid Context Record ID." Per the data list I'm trying to call, the ID field has an index of 0, so I was under the impression that's what I need to do when using a DataListLoadRequest. I removed the ResetTributeAcknowledgee() sub altogether to see if the error would go away. It did, however, the ResetTributee() doesn't seem to be working either leading me to believe I really have no idea what to do. Can anyone let me know what is wrong with this code? Thanks.
The context is not a parameter to the datalist and should be set through AckReq.ContextRecordID
As far as the simple datalist call I'm not entirely sure what you are trying to accomplish - is Me.TRIBUTEE already a simple datalist field or are you trying to populate a single value? Currently you are iterating over a collection of rows and overwriting on each subsequent row.