You need to sign in to do that
Don't have an account?

Adding multiple records in a way similar to add campaign members features
Hi folks,
I am new to VF. I am trying to create a VF page very similar to add campaign members functionality where one can select multiple contacts and attach them to campaign in one step.
Here is my use case,
1- I have a custom object (myObject__c) and
2- I would like users to click a button on myObject page layout .
3- This button will show a list of account records based on a simple query, with a checkbox (similar to enhanced list)
4- User will select one or more displayed account records by clicking checkbox and will click done.
5- The selected account Ids will be saved in a custom object (RelatedAcct__c).
Can we create "add campaign members" like fucntionality using VF page ?
Thanks!
Hmm-to make a button that leverages the custom object related list, I believe you need a list controller which will get the checked people for use in the button. I'm not sure you can access a custom object list controller where campaign member is the target as campaign members don't have a list controller (ie-list views).
I know you can't create a button in the Campaign Member related list due to this problem, but you might be able to create a button to add to the custom object enhanced lists (easier than creating a whole new VF list).
btw-if the goal is to add accounts to campaigns, I just created an app that makes this easier by leveraging 1 primary contact (dummy contact) for each account, which can be used for segmentation. Let me know and I can pass it along.
Thanks John for the reply.
My goal is to attach multiple accounts in one step to one custom object (myObject__c) record. Basically, I am looking for a functionality very similar to add campaign members feature but not for campaign object. My objects which I am trying to relate are custom object and the account object.
Check out StandardSetController in the apex guide on how to make the list controller. In your VF page, you can set the page action to the desired method.
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
Here's a good example of how to create a button that runs visualforce. You'd add the list controller details to this example to extend it to a list view.
http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/
I'd be interested in the app you mentioned that adds accounts to campaigns.
You can email me at dlimiero AT stadia DOT cc
Hi,
I need to add subscription members to a campaign and as the subscription is a custom object salesforce do not give an button to add to campaign on custom reports,
can you send me the app which will give me something to work on at my email address thesale.2009@gmail.com
I appreciate ur help in advance.
I feel as though if I could only get this list of campaigs to show here, that I'd be able to grab the informatiom I need to write the code to add them.
Here is my controller:
I'm not 100% clear on how to structure it to get what im looking for....I can reference the !campaign in my Visualforce page but the contents of the query are not showing. Here is my VF page: