Using Parameters in a Simple Datalist
<c:FormField FieldID="EXCLUSIONS" DataType="XML" Caption="Exclude constituents with the following solicit codes">
<c:Collection>
<c:Fields>
<c:FormField FieldID="ID" DataType="Guid" Hidden="true" Caption="ID" />
<c:FormField FieldID="SOLICITCODEID" DataType="Guid" Required="true" Caption="Solicit code">
<c:SimpleDataList SimpleDataListID="8f9da293-0452-4974-8206-6f67b3e56989" >
<c:Params>
<c:Param ID="INVITATIONID">
<c:Value>FORM!CONTEXTID</c:Value>
</c:Param>
</c:Params>
</c:SimpleDataList>
</c:FormField>
</c:Fields>
</c:Collection>
</c:FormField>
I would like to use the parameter which I have displayed in the Exclusions collection field, but this does not seem to work. I see all the solicit codes. What steps do I need to take to make sure this will function to filter the collection field correctly?
<c:Collection>
<c:Fields>
<c:FormField FieldID="ID" DataType="Guid" Hidden="true" Caption="ID" />
<c:FormField FieldID="SOLICITCODEID" DataType="Guid" Required="true" Caption="Solicit code">
<c:SimpleDataList SimpleDataListID="8f9da293-0452-4974-8206-6f67b3e56989" >
<c:Params>
<c:Param ID="INVITATIONID">
<c:Value>FORM!CONTEXTID</c:Value>
</c:Param>
</c:Params>
</c:SimpleDataList>
</c:FormField>
</c:Fields>
</c:Collection>
</c:FormField>
I would like to use the parameter which I have displayed in the Exclusions collection field, but this does not seem to work. I see all the solicit codes. What steps do I need to take to make sure this will function to filter the collection field correctly?
1
Comments
-
Hi Lynne!
You will need to create a uimodel to your form, and call YOURSIMPLEDATALIST.ResetDataSource() to make the parameter take effect.
I hope this helps
-Joseph Styons
https://www.styonssoftware.com0 -
I have tried that already. Somehow it does not seem to work.1
-
TL;DR: put your event handler in the collection's uimodel class, not in your "main" uimodel vb file.
OK, Lynne, I apologize - I didn't look at your example code closely enough.
Since your SDL fields are within a collection, there is a little more work to do.
Collection fields are little forms-within-a-form. They have their own UIModel class, and your event needs to be on that class.
You can find the collection's UIModel by expanding the form's UIModel.vb file. (Make sure 'show all files' is turned on in visual studio).
You should see:
1) The main form vb file
2) A collection vb file
3) A little XML file that tells the UIModel wizard where everything is, in case you ever use 'refresh uimodel'
#2 is interesting to us.
If you open it, you'll see a notice that says "Changes to this file may cause incorrect behavior and will be lost if the code is regenerated".
So we don't really want to put our changes here if we can help it.
Luckily, the class is marked "Partial". That means we can create a new, separate file, give it the same class name, and the compiler will treat it as part of the generated class.
Since the file is separate, it will be protected from any future UIModel stomping.
So, create a new Class in visual studio, and give it the same name as the partial class.
For example, to test this out, I made a collection called "LOCATIONS", and the generated class name was [CollectionDrivenSDLAddDataFormLOCATIONSUIModel].
So I created a new file and called it CollectionDrivenSDLAddDataFormLOCATIONSUIModel_Custom.vb, and in that file I put this code:
Public Class CollectionDrivenSDLAddDataFormLOCATIONSUIModel
Private Sub _countryid_ValueChanged(sender As Object, e As ValueChangedEventArgs) Handles _countryid.ValueChanged
STATEID.ResetDataSource()
End Sub
End ClassAnd that worked.
I've uploaded a working example to this repository:
https://github.com/StyonsSoftware/Training-Public
Once you pull it down, the files you'll want to pay attention to are:
\\Training.Catalog\\Add forms\\CollectionDrivenSDL.Add.xml
\\Training.UIModel\\CollectionDrivenSDLAddDataForm*.vbI hope this helps. For anyone who wants a walkthrough of a simpler example, I created a short training video, which you can find here.
Joseph Styons
https://www.styonssoftware.com1 -
Dear Joseph,
Thanks so much for that, including the excellent video. I've been creeping towards having to create a UIModel for some Global Changes I've created, and this is an excellent introduction.
Ciao,
David.1 -
I know this is a few years old now, but thanks for asking this question! And thanks to Joseph for providing the answer. I'd been completely stumped by this as I'd wrongly assumed the logic should be handled automatically when you create the UI model.
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 210 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 649 Blackbaud Grantmaking™
- 567 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 247 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 783 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)


