Symptoms
In a field on a K2 form, can the result of the field be programatically calculated via javascript or sql script?
Diagnoses
N/A
Resolution
1. Expressions can be applied to certain controlfields:
http://help.k2.com/onlinehelp/k2appit/userguide/current/default.htm#SF-ViewDesignerLayout-CalcExpression.html?Highlight=expression
2. If custom code is needed, Javascript/Jquery can be injected into an Expression to execute during runtime:
http://www.velocity-it.com/how-to-call-jquery-or-javascript-code-in-a-k2-smartform/
3. Perhaps stored procs can be used to calculate the values, and exposed as SmartObject/SmartObject methods and called when applicable. SQL service instance can be exposed as:
http://help.k2.com/onlinehelp/k2appit/UserGuide/1.5/default.htm#ServiceBrokers/SQLServer/SQL_Server_Service.htm
4. Perhaps web service can also be used to performed these calculations and exposed as SmartObject/Methods and called when applicable:
http://help.k2.com/onlinehelp/k2appit/UserGuide/1.5/default.htm#ServiceBrokers/EndPoints/EndpointBroker_Overview.htm