I am trying to create / Update Query Definition using SSJS WSProxy method.
This is my script:
<script runat="server" >
Platform.Load("core","1.1");
var api=new Script.Util.WSProxy();
var qd = {
Name : "WS_Created_Query",
CustomerKey : "myQueryDef124579",
TargetUpdateType : "Overwrite",
TargetType : "DE",
Target : {
Name : "Counts",
CustomerKey : "Counts-Key"
},
QueryText : "SELECT * from errorlog"
};
var myDE=api.createItem("QueryDefinition",qd);
</script>
but this Script not working.. can someone helps to identify the error, please. (I have a feeling QueryDefinition is not the correct object name for this method.?)
Thanks,