List all PublicationLists with SSJS
<script type="text/javascript" runat="server"> | |
Platform.Load("core", "1"); | |
var allPublicationLists = getAllPublicationLists(); | |
for (var i in allPublicationLists) { | |
Write("\n" + allPublicationLists[i]["ID"] + "|" +allPublicationLists[i]["Client"]["ID"] + "|" +allPublicationLists[i]["Name"]); | |
} | |
function getAllPublicationLists() { | |
var rr = Platform.Function.CreateObject("RetrieveRequest"); | |
Platform.Function.SetObjectProperty(rr, "ObjectType", "Publication"); | |
Platform.Function.SetObjectProperty(rr, "QueryAllAccounts", "True"); | |
Platform.Function.AddObjectArrayItem(rr, "Properties", "ID"); | |
Platform.Function.AddObjectArrayItem(rr, "Properties", "Name"); | |
Platform.Function.AddObjectArrayItem(rr, "Properties", "Category"); | |
Platform.Function.AddObjectArrayItem(rr, "Properties", "Client.ID"); | |
var reqParams = [0,0]; | |
var publications = Platform.Function.InvokeRetrieve(rr, reqParams); | |
return publications; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment