I'm trying to use this code and I'm facing this error:
<script runat="server"> Platform.Load("core","1"); var subscriber = {"Status": "Active"}; var key = '00003'; try { var sub = Subscriber.Init(key); } catch (e) { Write("<br> Fail: " + Stringify(e)); } </script> Error:
Fail: { "message":"CreateObject Function is not valid in content. This function is only allowed in non sendable content.\r\n Function: CreateObject(\"Subscriber\")", "description":"ExactTarget.OMM.FunctionExecutionException: CreateObject Function is not valid in content. This function is only allowed in non sendable content.\r\n Function: CreateObject(\"Subscriber\")\r\n Error Code: OMM_FUNC_CONTEXT_ERR\r\n - from Jint\r\n\r\n" } Also this code:
<script runat="server"> Platform.Load("core","1.1.1"); try { </script> %%[ SET @ll_sub = CreateObject("Subscriber") SetObjectProperty(@ll_sub, "EmailAddress", "[email protected]") SetObjectProperty(@ll_sub, "SubscriberKey", "00003") ]%% <script runat="server"> Platform.Load("core","1.1.1"); } catch (e) { Write("<br> Fail: " + Stringify(e)); } </script> Aaand also this one:
<script runat="server"> Platform.Load("core","1.1.5"); try { var prox = new Script.Util.WSProxy(); var props = ['Id', 'ListName', 'Description']; var filter = { Property: 'ListClassification', SimpleOperator: 'equals', Value: 'PublicationList' }; var result = prox.retrieve('List', props, filter); Write(result); } catch (e) { Write("<br> Fail: " + Stringify(e)); } </script> I'm getting the same error.
Error:
Fail: {"message":"Exception has been thrown by the target of an invocation.","description":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. - from mscorlib --> \r\n\r\n --- inner exception 1---\r\n\r\nExactTarget.OMM.FunctionExecutionException: WSProxy object is not valid in sendable content. This function is only allowed in non-sendable content.\r\n Object: Script.Util.WSProxy()\r\n Error Code: OMM_FUNC_CONTEXT_ERR\r\n - from OMMCommon\r\n\r\n\r\n\r\n"} Maybe a new release has impacted the use of those functions?