OK, I put almost my whole request into the subject, hope somebody will understand what I'm asking and be able to help :) Please forgive me if this has been answered elsewhere, I have searched the net and this site in vain.
I have already managed to deal with InfoPath forms being submitted to a form library contained in any site generated by a Site Template by successfully implementing a 'submit with code' scenario to read the form's location. But now how do I do the same thing for a Content Type, given that the template for the Content Type is stored in a Form Library on the root site and the content type is being triggered by a 'managed' content type Form Library which is located on any one of a number of sites generated from a Site Template ....
The most obvious solution to me would be finding a way to somehow get the url of the site where the 'content type' option was clicked, which would mean I could continue to use the 'submit with code' option I have already resolved modified to suit. I already am able to make this work if I type in the site url manually, however I would like to be able to automate this somehow.
Please advise if there is a way to do this, or if there is an alternate way to tell a content type to dynamically be submitted back to the form library it was requested from.
In summary:
1. I have several content types in one Form Library.
2. The Form Library is held in a Site Template from which many sites can and will be created.
3. The url for the sites will be made from the root url + a field stored in a master list on the root site (all rows) plus a duplicate list (one row only) on the template site.
4. The InfoPath templates for the content types are stored on the root site
5. I need the form template for the selected content type to be submitted back to the library it was requested from without requiring the user to complete the URL.
Thanks in advance.