1

I am trying to fetch salesforce contact details and display it in Cloud Pages. However its throwing an 500 error.

When I try with an Update Salesforce AMPScript, it works fine. What am I doing wrong?

%%[
VAR @SubKey, @result, @rs1 , @FirstName , @LastName , @row
Set @SubKey = [_subscriberKey]
SET @result = UpdateSingleSalesforceObject("Contact",@SubKey,"Membership_Type__c","Gold")

SET @rs1 = RetrieveSalesforceObjects("Contact", " FirstName,LastName","Id" , "=", @SubKey)
If RowCount(@rs1) > 0 Then
  Set @row = ROW(@rs1,1)
  Set @FirstName = FIELD(@row,"FirstName")
  Set @LastName = FIELD(@row,"LastName")

]%%
FirstName <br> %%=v(@FirstName)=%% <br>
LastName <br> %%=v(@LastName)=%% <br>
1
  • I was able to sort this out with below code. I was able to sort this out with below code. Issue was with space before SFDC First Name & there was no ENDIF. Sep 25, 2017 at 3:32

0

You must log in to answer this question.

Browse other questions tagged .