Symptoms
When executing SmartObjects that were constructed off of SQL Tables containing computed columns the SmartObject would throw the following error
The column nCOLUMN NAME] cannot be modified because it is either a computed column or is the result of a UNION operator.
•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)
Diagnoses
N/A
Resolution
This is expected behavior as the SQL Server Service Instance, from which the SQL SMOs are generated was not designed to accommodate computed columns.
The simplest way to get around this issue is to create a simple Stored Procedure to handle row creation.