I recreated the data connection several times to no avail.
I have now gone back to the initial idea of just using the ID field. However, I am now experiencing issues with this.
I publish the form, clear the form cache in Infopath of the published template, open the form, fill it in, submit it and it all works fine.
Then when I try to open ...