- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi Marcel,
I saw your post and did some investigation. Unfortunately I didn't find a real solution, but here are my observations:
1. you can see the method signature in the data schema nms:group:
<method library="nms:group.js" name="Register" pkonly="true">
<help>Add one or more records to the list</help>
<parameters>
<param desc="List of records to add" name="recipientList" type="DOMElement"/>
</parameters>
</method>It expects a DOMElement kind of object for recipient list.
2. the actual method code can be seen in nms:group.js under Javascripts. The method name is nms_group_Register.
3. Looking at the code you can see it will only execute for groups type 1 or 2; looking at the data schema again this means only for groups that are of type "File" (upload) or "List" (eg. Audience Manager Segment). Regular recipients lists (type 0, "Group") are not supported by this method.
4. In the code there is a loop over the provided recipient list object (remember: a DOMElement object):
for each( var eSelected in eRecipientList.data.* )
The eRecipientList.data.* is not working (at least in my tests), because there is no data attribute in the DOMElement class.
5. I tried to craft an XML structure that has a root node named "data", but this doesn't work:
var group = nms.group.load(<the group id>);
var recipients = DOMDocument.fromXMLString('<data><recipient firstName="Tobias" lastName="Lohmann" email="<email address>"/></data>');
group.Register(recipients.root); // the ".root" to get the DOMElement objectSo unfortunately no solution for you. It seems the DOMCharacterData class has a "data" attribute, but this represents only the text content of a node. So you might be able to provide the recipient list as a CDATA object inside a DOMElement.
... or you use the workaround you already figured out.
... or as another workaround you could add the recipient per code to the nms:rcpGrpRel schema
I hope this gives you a bit more insights to work with.
Best regards, Tobias