Using insertChildAfter to insert a repeating field

jeudi 5 mars 2015

My message can have repeating fields, and I'm trying to create a new PID 3 field before the currently existing one.



First I create the field, then I use the insertChildAfter function but it doesn't add my field. Any help appreciated. I've used the insertChildAfter to add a complete segment to the message before, but never to insert a field.



var PID3 = <PID.3/>;



PID3['PID.3.1'] = "";

PID3['PID.3.2'] = "";

PID3['PID.3.3'] = "";

PID3['PID.3.4'] = "";

PID3['PID.3.5'] = "MR";





msg['PID'].insertChildAfter(msg['PID']['PID.2'], PID3);





Using insertChildAfter to insert a repeating field

0 commentaires:

Enregistrer un commentaire