Hello,
I created a new attribute category with the Data Type Constituent Record. I am building a datalist and need to pull in the details associated to that constituent. Can someone provide some input on this please?
Hi Pam,
There's a session at the BB Developers' Conference on Advanced Configuration. It's a skills lab so you could ask our team there if you don't get an answer before then
Name
Making the Most of Design Mode for Blackbaud CRM™
Date & Time
Wednesday, June 8, 2022, 3:30 PM - 4:30 PM
Description
In this Skills Lab, the team from BrightVine Solutions will walk you through advanced configuration approaches with Design Mode. This is a Skills Lab suitable for administrators and business analysts.
Thank you so much for this info. I will be sure to attend this session.
@Pamela Hassler
It depends a little bit on whether you choose the “Allow only one per record” option.
I'll go through both scenarios. I've created two attributes (screenshots below). One is “Best friend”, and it's “only one". The other is “Other friends”, and more than one of those are allowed.
When you create those attributes, CRM will automatically generate a table name for each one. You can see the table names by running this query:
SELECTAC.[NAME], TC.TABLENAMEFROMATTRIBUTECATEGORY ACJOIN TABLECATALOG TC ON TC.ID = AC.TABLECATALOGIDWHERE AC.[NAME] IN('BEST FRIEND','OTHER FRIENDS')
Both tables will have a CONSTITUENTVALUEID, which contains the Constituent ID of the “Best friend” or the “Other friend”. The only difference between the two tables is that the “Best friend” table can be joined directly to the CONSTITUENT table on the ID column, but the “Other friend” attribute must be joined by the CONSTITUENTID column (because there can be more than one).
So, your Datalist might use SQL like this:
--This will return only one row per constituent
SELECTCON.[NAME] AS CONSTITUENTNAME,BESTFRIEND.[NAME] AS BESTFRIENDNAMEFROMCONSTITUENT CON--This table came from the earlier query; yours will be differentLEFT JOIN ATTRIBUTECFB911E5380D4D0394E7B00EA34C8782 BF ON BF.ID = CON.IDLEFT JOIN CONSTITUENT BESTFRIEND ON BESTFRIEND.ID = BF.CONSTITUENTVALUEID
--This may return any number of rows per constituentSELECT CON.[NAME] AS CONSTITUENTNAME,OTHERFRIEND.[NAME] AS OTHERFRIENDNAMEFROM CONSTITUENT CON --This table came from the earlier query; yours will be different LEFT JOIN ATTRIBUTE147BEB11AA0E485CB1829658618CAE74 OTF ON OTF.CONSTITUENTID = CON.ID LEFT JOIN CONSTITUENT OTHERFRIEND ON OTHERFRIEND.ID = OTF.CONSTITUENTVALUEID
Some things to keep in mind: