Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script runat="server">
- Platform.Load("Core", "1.1.1");
- var rr = Platform.Function.CreateObject("RetrieveRequest");
- Platform.Function.SetObjectProperty(rr, "ObjectType", "EmailSendDefinition");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "Name");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "EmailSubject")
- Platform.Function.AddObjectArrayItem(rr, "Properties", "SendDefinitionList");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "DeliveryProfile.CustomerKey");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "SenderProfile.CustomerKey");;
- Platform.Function.AddObjectArrayItem(rr, "Properties", "IsMultipart");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "CategoryID");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "CreatedDate");
- Platform.Function.AddObjectArrayItem(rr, "Properties", "ModifiedDate");
- //"From" date
- var sfp1 = Platform.Function.CreateObject("SimpleFilterPart");
- Platform.Function.SetObjectProperty(sfp1, "Property", "ModifiedDate");
- Platform.Function.SetObjectProperty(sfp1, "SimpleOperator", "greaterThanOrEqual");
- Platform.Function.AddObjectArrayItem(sfp1, "Value", "2015-08-27T00:00:00.000");
- //"To" date
- var sfp2 = Platform.Function.CreateObject("SimpleFilterPart");
- Platform.Function.SetObjectProperty(sfp2, "Property", "ModifiedDate");
- Platform.Function.SetObjectProperty(sfp2, "SimpleOperator", "lessThanOrEqual");
- Platform.Function.AddObjectArrayItem(sfp2, "Value", "2015-08-28T00:00:00.000");
- //Adding two Simple filters together to create a Complex filter
- var cfp = Platform.Function.CreateObject("ComplexFilterPart");
- Platform.Function.SetObjectProperty(cfp, "LeftOperand", sfp1);
- Platform.Function.SetObjectProperty(cfp, "LogicalOperator", "AND");
- Platform.Function.SetObjectProperty(cfp, "RightOperand", sfp2);
- //Add the Complex filter to the RetrieveRequest
- Platform.Function.SetObjectProperty(rr, "Filter", cfp);
- var retrieveStatus = [0, 0, 0];
- var retrieveResult = Platform.Function.InvokeRetrieve(rr, retrieveStatus);
- Write(Stringify(retrieveResult));
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement