I'm coding a data import and creating my content nodes programmatically. I has this simple data type using the embedded content data type. it has 2 textstring values "Text" and "Telephone", it's a list of phone numbers.
Now I'm getting my nodes like this :
var newNode = Document.MakeNew(nom, DocumentType.GetByAlias("SomeCoolType"), User.GetCurrent(), 5481);
Programmatically creating embedded content values
Hello,
I'm coding a data import and creating my content nodes programmatically. I has this simple data type using the embedded content data type. it has 2 textstring values "Text" and "Telephone", it's a list of phone numbers.
Now I'm getting my nodes like this :
var newNode = Document.MakeNew(nom, DocumentType.GetByAlias("SomeCoolType"), User.GetCurrent(), 5481);
Then I can set normal values :
newNode.getProperty("adresse").Value = formatedAddress;
But for embedded content I can't get it to work :
var listeDeNumerosDeTelephone = "<listeDeNumerosDeTelephone>" + "<data>" + "<item id=\"1\"" + "<texte propertyid=\"1\">Renseignements généraux</texte>" + "<telephone propertyid=\"2\">" + tel + "</telephone>" + "</item>" + "<item id=\"2\"" + "<texte propertyid=\"1\">Fax</texte>" + "<telephone propertyid=\"2\">" + fax + "</telephone>" + "</item>" + "</data>" + "/<listeDeNumerosDeTelephone>"; newNode.getProperty("listeDeNumerosDeTelephone").Value = listeDeNumerosDeTelephone;Has anyone done this before?
Thanks!
I've tried with "<listeDeNumerosDeTelephone" and without.
Ok, I only had to close my item tag... nice typo seb :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.