I strongly suspect that the issue is that you are using Personalization Strings in on a landing page. These are meant to emails and not landing pages. The renderer is letting you get away with it (probably a bug), but when you "live" test it you get a 500 error
(Usually due to malformed Server Side Logic in Marketing Cloud).
I would suggest following:
- Use either MicrositeURL() or CloudPagesURL()CloudPagesURL() (Salesforce has moved the documentation to this but works the same way as the previous function - for cloud pages) in the links to direct your subscribers to the landing page. This has the advantage of encrypting the data and passing subsciber context data (Email Address, Susbcriberkey and any other fields you want to pass)
- On your landing page, use the RequestParameter() function to capture this from the query string.
- Pass the variable to the RetrieveSalesforceObjects call.
<p> <a title="MyPage" href="%%=RedirectTo(CloudPagesURL(77777))=%%" alias="CallItAFriendlyName" conversion="false">Click to Here to Visit My Landing Page</a> </p>
- On your landing page, use the RequestParameter() function to capture this from the query string.
- Pass the variable to the RetrieveSalesforceObjects call.
It would look like this:
%%[
var @rs, @Accrow, @CustomerName, @numRows, @Subscriberkey
SET @Subscriberkey = RequestParameter("Subscriberkey")
Set @rs= RetrieveSalesforceObjects("Account", "FirstName", "Id", "=", @Subscriberkey)
Set @numRows= RowCount(@rs)
Set @Accrow = Row(@rs, @numRows)
Set @CustomerName = FIELD(@Accrow, 'FirstName')
]%%
%%=v(@CustomerName)=%%