I am trying to add / update a test record in a data extension from a cloud page but I keep getting 500 - Internal server error
I have looked at the online resources and some answers here as well before creating this question but I can't seem to understand where is the issue in my code?
Here is my cloud page (landing page) code:
%%[
Set @subkey = "[email protected]"
SET @deRequest = CreateObject("DataExtensionObject")
SetObjectProperty(@deRequest, "CustomerKey","12345-1234-1234-1234-12345678")
SET @lue_prop = CreateObject("APIProperty")
SetObjectProperty(@lue_prop, "Name", "SubscriberKey")
SetObjectProperty(@lue_prop, "Value", @subkey)
AddObjectArrayItem(@deRequest , "Key", @lue_prop)
SET @updateOptions = CreateObject("UpdateOptions")
SET @saveOptions = CreateObject("SaveOption")
SetObjectProperty(@saveOptions, "PropertyName", "DataExtensionObject")
SetObjectProperty(@saveOptions, "SaveAction", "UpdateAdd")
AddObjectArrayItem(@updateOptions, "SaveOptions", @saveOptions)
SET @ts_statusCode = InvokeUpdate(@deRequest, @de_statusMsg, @errorCode, @updateOptions)
IF @ts_statusCode != "OK" THEN
RaiseError(@de_statusMsg, 0, @de_statusCode, @errorCode)
ENDIF
]%%
<html>
<head>
</head>
<body style="font-family:sans-serif;">
<br/>@subkey: %%=v(@subkey)=%%
<br/>@ts_statusCode: %%=v(@ts_statusCode)=%%
</body>
</html>
ERROR: Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.