Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. <script runat="server">
  2. Platform.Load("Core", "1.1.1");
  3.  
  4. var rr = Platform.Function.CreateObject("RetrieveRequest");
  5. Platform.Function.SetObjectProperty(rr, "ObjectType", "EmailSendDefinition");
  6. Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");
  7. Platform.Function.AddObjectArrayItem(rr, "Properties", "Name");
  8. Platform.Function.AddObjectArrayItem(rr, "Properties", "EmailSubject")
  9. Platform.Function.AddObjectArrayItem(rr, "Properties", "SendDefinitionList");
  10. Platform.Function.AddObjectArrayItem(rr, "Properties", "DeliveryProfile.CustomerKey");
  11. Platform.Function.AddObjectArrayItem(rr, "Properties", "SenderProfile.CustomerKey");;
  12. Platform.Function.AddObjectArrayItem(rr, "Properties", "IsMultipart");
  13. Platform.Function.AddObjectArrayItem(rr, "Properties", "CategoryID");
  14. Platform.Function.AddObjectArrayItem(rr, "Properties", "CreatedDate");
  15. Platform.Function.AddObjectArrayItem(rr, "Properties", "ModifiedDate");
  16.  
  17. //"From" date
  18. var sfp1 = Platform.Function.CreateObject("SimpleFilterPart");
  19. Platform.Function.SetObjectProperty(sfp1, "Property", "ModifiedDate");
  20. Platform.Function.SetObjectProperty(sfp1, "SimpleOperator", "greaterThanOrEqual");
  21. Platform.Function.AddObjectArrayItem(sfp1, "Value", "2015-08-27T00:00:00.000");
  22.  
  23. //"To" date
  24. var sfp2 = Platform.Function.CreateObject("SimpleFilterPart");
  25. Platform.Function.SetObjectProperty(sfp2, "Property", "ModifiedDate");
  26. Platform.Function.SetObjectProperty(sfp2, "SimpleOperator", "lessThanOrEqual");
  27. Platform.Function.AddObjectArrayItem(sfp2, "Value", "2015-08-28T00:00:00.000");
  28.  
  29.  
  30. //Adding two Simple filters together to create a Complex filter
  31. var cfp = Platform.Function.CreateObject("ComplexFilterPart");
  32. Platform.Function.SetObjectProperty(cfp, "LeftOperand", sfp1);
  33. Platform.Function.SetObjectProperty(cfp, "LogicalOperator", "AND");
  34. Platform.Function.SetObjectProperty(cfp, "RightOperand", sfp2);
  35.  
  36. //Add the Complex filter to the RetrieveRequest
  37. Platform.Function.SetObjectProperty(rr, "Filter", cfp);
  38.  
  39. var retrieveStatus = [0, 0, 0];
  40. var retrieveResult = Platform.Function.InvokeRetrieve(rr, retrieveStatus);
  41.  
  42. Write(Stringify(retrieveResult));
  43.  
  44. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement