Created
December 7, 2018 07:54
-
-
Save matrostik/d6dc12dd10d8691b532007578fc1a2dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" runat="server"> | |
Platform.Load("core", "1.1.5"); | |
var prox = new Script.Util.WSProxy(), | |
objectType = "Email", | |
cols = ["Name"], | |
moreData = true, | |
reqID = null, | |
numItems = 0; | |
while(moreData) { | |
moreData = false; | |
var data = reqID == null ? | |
prox.retrieve(objectType, cols) : | |
prox.getNextBatch(objectType, reqID); | |
if(data != null) { | |
moreData = data.HasMoreRows; | |
reqID = data.RequestID; | |
if(data && data.Results) { | |
for(var i=0; i< data.Results.length; i++) { | |
Platform.Response.Write(data.Results[i].Name); | |
numItems++; | |
} | |
} | |
} | |
} | |
Platform.Response.Write("<br />" + numItems + " total " + objectType); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment