That code sample should work.
Can you try the following (just put the field name inside a variable):
%%[
SET @FieldName = FieldName
]%%
<a href="%%=RedirectTo(@FieldName)=%%" target="_blank"/>
This error is caused when the online view cannot access the data in the Sendable Data Extension you originally sent to. Usually because the Data Extension has been cleared, overwritten or deleted. When you click the view_email_url, the hosted page will try to render the email on the fly based on the data extension it was sent to. If the data is gone, this error is shown.
The solution is to use the _SendContext variable to pull the fields from the Sendlog instead of the Sendable DE.
In the following code example. I use _SendContext to lookup the values out of the Sendlog based on the combination of JobID, SubscriberID and BatchID. The combination of these 3 fields acts as the primary key in any ET Sendlog and will never be duplicated (unless you insert some data yourself). Technically they are not marked as the primary keys, but you can be confident the combination will be unique and you will always pull back the correct record.
%%[
/* If the message is being viewed as a webpage, on social forward, or as forward to a friend */
if _MessageContext == "VAWP" or _MessageContext == "Social" or _MessageContext == "FTAF" then
/* Set the firstname from the Sendlog */
set @FirstName = LookUp("Sendlog","FirstName","SubID",SubscriberID,"JobID",JobID,"BatchID",_JobSubscriberBatchID)
else
/* Set the firstname variable from the DE */
set @FirstName = FirstName
endif
]%%
Here is the article on ET help docs about SendContext, but it does not show to use BatchID which I feel is incomplete.
http://help.exacttarget.com/en-US/documentation/exacttarget/content/ampscript/how_to_use_ampscript_to_contextually_display_send_time_content/
Best Answer
This is definitely hacky, but it has worked for me in the past. You'll need to open a ticket with SFMC Support to request an update to your WAC string, so that the very last parameter name in your query string can be used your very last Additional Email Attribute. So if you already have and use 5
AdditionalEmailAttribute
's, then this solution won't work.Hypothetically let's say you already use 4, then the 5th would be added by SFMC support and could have a parameter name of "anchor". Then in your AdditionalEmailAttribute5 input in the email properties area, you can add your anchor, with the hashtag (#page-anchor in this example).
So your final url parameter would look like:
and would resolve to:
This needs to be at the very end of the WAC string and the very end of the url overall, or else it will not work. Be sure to test thoroughly by sending "live" emails to yourself (as opposed to test sends), so the WAC will be appended. This solution may not work in every case an anchor is needed, especially if there are extra redirects happening on the page you are linking to.