Get Enumerations in JavaScript
Hello everyone,
I currently try to get enumerations list in a javascript object.
I wasn't able to find a standarf function in the JS API of campaign, so I fetch all the values using xtkQueryDef.
The return of my query is this:
<enumValue-collection> <enumValue label="4305615529813"/> <enumValue label="4305615440668"/> </enumValue-collection>
When I try to parse the XML to get the child nodes (<enumValue>) that actually contain the values I need, I face the issue that it doesn't recognize the hyphen in the parent node. The error message tells me that "collection" isn't defined (it cuts the string at the hyphen).
04.08.2017 13:15:48 js JST-310000 Fehler bei der Auswertung des Scripts 'rosImportProducts/js' Zeile 40: collection is not defined.
This is what I try:
for(var ean in availProductsRes.enumValue-collection)
logInfo(availProductsRes.enumValue-collection[ean].@label);
Is there a better way of fetching an enumation list in JS?
Or is this issue (hypen in XML node name) already known at Adobe?
Best regards
Alex
