1

Here is the code on my cloud page. I'm a trying to change the status of a campaign member to Responded if they click on the RSVP button in an email. I am getting a 500 error. Does anyone see anything wrong with my code?

%%[

var @FirstName, @CampaignMemberID, @status

set @FirstName = RequestParameter('First Name')

set @CampaignMemberID = RequestParameter('CampaignMemberID')

/* on page load */

set @status = UpdateSingleSalesforceObject('CampaignMember',@CampaignMemberID,'Status','Responded')
]%%

%%First Name%%

Thank you for registering for our event, looking forward to seeing you there.
2
  • @Adam Thanks for the suggestion. I tried it and I'm still getting a 500 error. I thought I must be doing something stupid wrong but if I take out all the code and only leave the text it works. Any other suggestions? – LB47606 Mar 11 '18 at 3:01
  • Updated my answer down below. – Adam Spriggs Mar 11 '18 at 3:18
0

I'd suggest adding some debugging statements to see what's not getting populated before you add in your UpdateSingleSalesforceObject() function:

%%[

var @FirstName, @CampaignMemberID, @status

set @FirstName = RequestParameter('First Name')

set @CampaignMemberID = RequestParameter('CampaignMemberID')

output(concat("<br>FirstName: ", @FirstName))
output(concat("<br>CampaignMemberID: ", @CampaignMemberID))

/* on page load */

/*
 set @status = UpdateSingleSalesforceObject('CampaignMember',@CampaignMemberID,'Status','Responded') 
 */
]%%

%%=v(@firstName)=%%

Thank you for registering for our event, looking forward to seeing you there.

Update

You probably should be using QueryParameter() instead of RequestParameter() if you're just retrieving URL parameters by name:

%%[

var @FirstName, @CampaignMemberID, @status

set @FirstName = QueryParameter('First Name')

set @CampaignMemberID = QueryParameter('CampaignMemberID')

output(concat("<br>FirstName: ", @FirstName))
output(concat("<br>CampaignMemberID: ", @CampaignMemberID))

/* on page load */

/*
 set @status = UpdateSingleSalesforceObject('CampaignMember',@CampaignMemberID,'Status','Responded') 
 */
]%%

%%=v(@firstName)=%%
2
  • Something worked!! The results were: FirstName: CampaignMemberID: Is this what I was expecting back? Field names but no data? – LB47606 Mar 11 '18 at 18:02
  • 1
    Nope, you were supposed to get field values too. This indicates that issues lies with the original page load. – Christopher Carswell Apr 16 '18 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.