Symptoms
Package and Deploy ok but get an error when looking up from an external db
Diagnoses
You get the following error after you have packaged and deployed db and solution to separate server:
ExecuteScalar requires an open and available Connection. The connection's current state is closed.
•Type: SourceCode.SmartObjects.Client.SmartObjectException
•Source: SourceCode.SmartObjects.Client
•Method Base
◦Member Type: Method
◦Name: ExecuteScalar
◦Module
Scope Name: SourceCode.SmartObjects.Client.dll
◦Declaring Type
Full Name: SourceCode.SmartObjects.Client.SmartObjectClientServer
•Stack Trace:
at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteScalar(SmartObject smartObject, DataTable inputTable)
at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr)
at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml)
at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
Resolution
The actual issue here is to do with a rule in the form whereby the rule was executing a smart object method. The smart object did not seem to fire correctly when the form was ran getting the following error.
ExecuteScalar requires an open and available Connection. The connection's current state is closed.
It would be best to refresh the service instance tied to the form and then further remap the smart objects and rules tied to the smo as well.