I'm trying to add a row in a Data Extension using the following code:
<script runat="server">
Platform.Load("Core","1");
try {
var deRows = {offer_id:"10000",title:"Test",priceForEndUser:"70000",dealer_neighborhood:"Test"};
var dataExtension = DataExtension.Init("teste_offers");
var dmlResult = dataExtension.Rows.Add(deRows);
Platform.Response.Write(String(dmlResult)+'<br>');
//Platform.Function.InsertData("teste_offers",["offer_id","title","priceForEndUser","dealer_neighborhood"],["10000","Test","70000","Test"]);
}
catch (ex) {
Platform.Response.Write("An error occurred: " + ex);
}
</script>
I'm debugging the code using Cloud Pages and the variable dmlResult always return 0 and no data is inserted.
I also tried the Platform.Function.InsertData statement but it returns me this error 'An error occurred: An error occurred when attempting to execute an InsertData function call. See inner exception for details.'