Storing data in mData / Memo XML
/** store tmp changes in xml field **/
xmlData = '<?xml version="1.0"?>'
+'<recipient>'
+'<comment>This is a test</comment>'
+'<changes firstName="David" lastName="Garcia" email="myemail@email.com"></changes>'
+'</recipient>'
sqlExec("UPDATE NmsRecipient SET mData = '"+xmlData+"' WHERE iRecipientId='"+parseInt(ctx.recipient.@id)+"' ");
The first test was the JSON method (recipient.comment actually stores the string in the mData field)
var recipient = NLWS.nmsRecipient.create(
{recipient:{
email : 'dummy@dummy.com',
lastName : 'onetwo',
firstName : 'three',
origin : 'Preference Centre'}})
recipient.comment = "This is my comment";
recipient.save()
Method (session write) - the changes node did not work at first, so I've extended the recipient schema and added a new xml type field which allows me to access the mdata node easily.
xtk.session.Write(
<recipient _operation="insert" email="dummy@dummy.com" firstName="Garcia" xtkschema="nms:recipient">
<comment>This is a test</comment>
<changes>Changes test</changes>
</recipient>);
var recipient = NLWS.nmsRecipient.create(<recipient
email = "dummy@support.com"
lastName = "Neolane"
firstName = "Suspportq">
<comment>This is a test</comment>
<changes>This is my changes</changes>
</recipient>)
recipient.save();

var recipient = NLWS.nmsRecipient.create(<recipient
email = "dummy@support.com"
lastName = "Neolane"
firstName = "Suspportq">
<comment>This is a test</comment>
<changes firstName="David lastName="Garcia">
</recipient>)
recipient.save();
@Darren_Bowers @LaurentLam @Marcel_Szimonisz @Adhiyan @Jonathon_wodnicki @CedricRey @Milan_Vucetic @Manoj_Kumar_ @Florian_Courgey @Jean-Serge_Biro


