Ravindra:when i debugging the Info Path code and access the SPSite and SPWeb
object then it gives error "The Web application at http://sitename/
could not be found. Verify that
you have typed the URL correctly. If the URL should be serving existing
content, the system administrator may need to add a new request URL
mapping to the intended application."
My site is running
correctly in browser and access the SPSite and SPweb object but still
getting error "web application could not be found" while Info Path
preview debugging.
In other words, the reference of ErnestoM tells what is quite obvious without any references:
- "The code is executed on a different machine - The SharePoint object model (except the Client API) requires to be run on the SharePoint server itself. It is not possible to run the application on a server which is not within the same SharePoint farm the code is trying to access"
Preview/Filler form is run on client machine, while Infopath browser form on Sharepoint Server through IPFS (Sharepoint Server Infopath Form Services)
Generally speaking, Infopath code-behind is client code and one cannot assure where the user choose to run it, or can?(i.e. I would have avoided server-side code in Infopath code-behind. Any other, point of view on this?
This is rather important conceptually for application design/architecture, is not it?