I havent done it but just trying to help (and learn at the same time)... 
From what I read it is better to assign the link via the routing button:
And there you should assign the iddoc param there:
An explenation from Patrick that I think is related...