0

My idea is to have the "Add to Campaign" button at the top of the Contact page, rather than on the related list, at the bottom of the page.

I´ve created the button by navigating to "Contacts" - "Buttons, Links and Actions" - "New Button or Link", and then using the campaign lookup page´s url as the button´s url. However, when clicked upon, the button doesn´t take me any further than that lookup page. I can see my campaigns, but clicking upon them does nothing. I´ve also tried referencing the Contact ID field within the url: this results in no campaigns being shown on the lookup page at all.

Any ideas as to what I´m doing wrong?

Edit:

https://eu7.salesforce.com//003?rlid=CampaignMembers&id={!Contact.Id}

^Latest attempt, which results in this error message:

The value of the "rlid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.

1
  • 1
    It'd be useful if we could see the code for your button. Could you edit your question to include the code?
    – sfdcfox
    Commented Nov 15, 2016 at 16:00

1 Answer 1

1

I don't know if this is exactly what you're looking for, but I actually just borrowed the code from the existing button (warning: may not be future-proof). Here's the button I created:

Label       Add to Campaign     Object Name     Contact
Name        Add_to_Campaign      
Namespace Prefix                Display Type    Detail Page Button
Behavior    Execute JavaScript       
OnClick JavaScript  openLookup('/_ui/common/data/LookupPage?lkpr={!Contact.Id}&lktp=701&enableScopes=1&addToCampaign=1',670,'1','')

This opens a new window for the user to select a campaign, and on selection, they're prompted to set a new status and any other custom attributes for the campaign.

2
  • Do we have something similar to work on Lightning as the above solution only works with Classic. I tried adding the JS and on the button does not show up on lightning but works well on Classic Commented Jan 16 at 18:12
  • @PavanKemba This workaround isn't needed. You can add the standard button. See How do I add contacts and leads to campaigns?.
    – sfdcfox
    Commented Jan 17 at 11:39

You must log in to answer this question.