Hi Jonas
If you look at the SDK documentation for the project item you will see that it takes a Language property
However I assume your already setting this property and the issue you have is that the content link is not unique per language branch and therefore when you try and save the project item it is telling you it already exists in the project.
I would check you logic to ensure that when you get the content and modify that the content is per language to ensure you get a unique content reference / link per language branch.
Thanks
Paul
Would you mind posting some of your code?
Also, for this one time jobs I'd recommend you to use a terminal app instead of scheduled jobs. I wrote a blog post on how to get started https://www.herlitz.io/2024/02/22/optimizely-cms-in-a-terminal-console-app/
Sample source https://github.com/EricHerlitz/optimizely-cms-terminal
Here's a blog post that's (I think) doing something similar: https://www.cdisol.blog/2021/04/30/handle-episerver-projects-programmatically/
Hi All.
Creating a scheduled job which is supposed to migrate some data from one property to another (for two content types) in a controlled manner.
For this I would like to create a project so its easier for the editor to see what has changed and can publish one item at the time, or everything if editor is happy with the changes.
The job is supposed to be a one time job, not to be run several times.
The job creates does the following:
We however get an error when adding instance to project when an instance of BlockTypeX instance is added to project when another language branch already has been added: "An item with same key has already been added." So i guess language branch has to be referenced to the project item?!
The documentation is not helpful :D Seems its missing a lot regarding the programmic workflow ;)