Using Name column as Primary Key (About Relations)
Hi Richard,
Keeping busy with your (great) CMSImport Package. I'm running into the following: I've got an xml datasource that changes overtime, and gets imported everyday.
Due to the changes, it is possible that the ID of the records change. If that happens, CMSImport cannot update the node, but creates a new one. (due to the relationmodel)
I therefore changed the Primary Key to the Name within the XML record. This because the Name never changes. It seems to work, but do you maybe have experience with this? Is this method possible?
In short: I want to link the name record in the xml to the NodeName, and based on the name update a node (or create a new node)
Great that you like the package.Usually it's the name that change instead of the id? Are you using multiple datasources? But it will work as long as you don't have duplicate names and you don't change the name.\
No it's only one datasource, but this actually is a textfile export from a Shop Administration Software. This export does not have a primary key, and might change the order, so adding a key does not help.
But it's easy, as soon as the name changes, I've written some code that deletes the old record, and adds a new one.
Using Name column as Primary Key (About Relations)
Hi Richard,
Keeping busy with your (great) CMSImport Package.
I'm running into the following: I've got an xml datasource that changes overtime, and gets imported everyday.
Due to the changes, it is possible that the ID of the records change. If that happens, CMSImport cannot update the node, but creates a new one. (due to the relationmodel)
I therefore changed the Primary Key to the Name within the XML record. This because the Name never changes.
It seems to work, but do you maybe have experience with this? Is this method possible?
In short: I want to link the name record in the xml to the NodeName, and based on the name update a node (or create a new node)
Hope to hear from you.
Martin
Hi Martin,
Great that you like the package.Usually it's the name that change instead of the id? Are you using multiple datasources? But it will work as long as you don't have duplicate names and you don't change the name.\
Hope this helps,
Richard
PS: Just seen you work for a dutch company already member of the Umbraco Usergroup? http://www.linkedin.com/groups?home=&gid=3326363&trk=anet_ug_hm
Hi Richard,
great, I'll check it out! (the usergroup)
No it's only one datasource, but this actually is a textfile export from a Shop Administration Software. This export does not have a primary key, and might change the order, so adding a key does not help.
But it's easy, as soon as the name changes, I've written some code that deletes the old record, and adds a new one.
Martin
is working on a reply...