I've heard there is a script out there that will automatically update the Program name in the Constituent Record based on the membership level. Does anyone have this script? Thanks in advance!
I have something to update those in a list, we use it to update Anonymous programme names in bulk. Would imagine you could do the same for each membership in their own dynamic list?
Would that be of use? Can email over if helpful.
Yes, send it over please! I'd love to take a look at it. Thank you!
Hey David,
Did you ever get this going? If so, would you share?
Thanks,
Dot
Unfortunately, I never received the script. :(
Hi all, sorry to hear you didn't recieve my email David!!
This is the version I used to update TX_CUST_PROGRAM with same programme name for all constituents in a list. You'd need to make seperate lists and rename each time but useful for bulk. Not the perfect solution but one we used at the time. Please test first as always. You'll want to note your program and donation levels first before doing this.
insert into dbo.TX_CUST_PROGRAM (customer_no,program_no,donation_level,cust_pname,sort_name)--view table with new information before committingselect lc.customer_no,4,1,'Anonymous','Anonymous'from t_list_contents lcleft join dbo.TX_CUST_PROGRAM cp WITH (NOLOCK) on cp.customer_no=lc.customer_no and cp.program_no=4where lc.list_no=116338and cp.program_no is null
insert into dbo.TX_CUST_PROGRAM (customer_no,program_no,donation_level,cust_pname,sort_name)
--view table with new information before committing
select lc.customer_no,4,1,'Anonymous','Anonymous'
from t_list_contents lc
left join dbo.TX_CUST_PROGRAM cp WITH (NOLOCK) on cp.customer_no=lc.customer_no and cp.program_no=4
where lc.list_no=116338
and cp.program_no is null
--OR can be done through the following methodsselect lc.customer_no,4,1,'Anonymous','Anonymous'from t_list_contents lcwhere lc.list_no=113688and lc.customer_no not in (select customer_no from dbo.TX_CUST_PROGRAM cp where cp.program_no=4)--orselect lc.customer_no,4,1,'Anonymous','Anonymous'from t_list_contents lcwhere lc.list_no=113688and not exists (select 1 from dbo.TX_CUST_PROGRAM cp where cp.customer_no=lc.customer_no and cp.program_no=4)
--OR can be done through the following methods
where lc.list_no=113688
and lc.customer_no not in (select customer_no from dbo.TX_CUST_PROGRAM cp where cp.program_no=4)
--or
and not exists (select 1 from dbo.TX_CUST_PROGRAM cp where cp.customer_no=lc.customer_no and cp.program_no=4)