SmartObject Considerations and Best Practices
When creating and using SmartObjects, keep in mind the following considerations and best practices.
All views, forms and workflows use the latest version of a SmartObject. You cannot access or select the previous version of a SmartObject while designing these objects that use data from the SmartObject. Once you modify and save a SmartObject, it is given a new version number and all objects that depend on it use the latest version.
Authentication, determined by how the service instance is configured, affects the way in which the SmartObject and its data is accessed. For more information see the Authentication topic.
You can perform SmartObject Administration using the K2 Management site. A number of tasks are available to you, such as granting permissions to users, groups or roles that control who can execute methods for SmartBox SmartObjects. For more information see the SmartObject Security and SmartBox Security sections.
Editing and then saving a SmartObject creates a new version of the SmartObject. If you've used the SmartObject in a view, for example, you must make changes to the view to include the changes made to the SmartObject. For example, if there is a view called Region Details which uses the Region SmartObject, when you edit the SmartObject to include a new property such as Cost Center Code is added, you must update the Region Details view to also include the new property.
When deleting a SmartObject, you must first remove all dependencies (in the correct order) before deleting it. The order of deletion should always be forms followed by views and then the SmartObject. When deleting a SmartBox SmartObjects, the SmartObject and its related data is deleted from the K2 Server. For other SmartObjects, only the connection from K2 to the line of business system is deleted, and the LOB data remains.
Furthermore, the K2 Designer prevents you from deleting a SmartObject if there are any dependencies found. If a form or view uses the SmartObject as a data source, you must edit that form or view and remove the SmartObject binding before you can delete the SmartObject. If you have multiple forms and views bound to a single SmartObject, you must do it for all forms and views first. In the K2 Designer, you can check dependencies by expanding the + icon next to the SmartObject in the category to see if there are any views and forms that depend on the SmartObject.
As mentioned, if the SmartObject is used as a data source by forms or views, you receive a warning message when trying to delete it. However, if a workflow, custom form, report, rule, or any other object has a dependency on the SmartObject, you are not warned. Deleting the SmartObject in this case may result in a broken application. You should only delete a SmartObject if you fully understand the impact of doing so.
You can move and deploy SmartObjects to different environments and sites. For more information see the Deploying Applications between environments using Package and Deployment topic.
Read the Performance Considerations - SmartForms knowledge base article for guidance on how to improve overall performance.