Recently I encountered an issue while deploying a package from one environment to another. While testing the smartobject after the deployment, the following error message pop up :
Reason: this error is thrown when the underlying method (tables or stored procedure in this case) cannot be found. This could be due to deletion or when the external component is not setup yet.
Steps to create the above scenario:
- Create a few stored procedures
- Refresh the Service Instance so that Stored Procedures are retrieved from the DB .
- Create the smartobjects from the instances.
4. Now go back to the DB and delete one of the previously created Stored Procedure and add another one. Then refresh again (but do not create or generate the smartobject yet):
As can be seen in the above image, there is a difference between the stored procedures. [dbo].[GetAnotherThing] does not exist and a new stored procedure [dbo].[GetSomethingFromTableDrop] is added. When the SmartObject GetAnotherThing is executed, the error dialog in Figure 1 will be shown.
Most of us when generating SmartObjects will use the Service tester to do so and select the Create method (Figure 4). When the Create SmartObjects method is used, smartobject with the missing method will still be there.
The reason is that when this method is used, it does not delete any smartobjects since it is a smartobject creation/update method (Figure 5).
Instead use the Generate smartobject method (Figure 6), this method will display the smartobject to be deleted as well besides the Create/Update method, BUT the drawback is that, it does not allow you to select the category to create the smartobject to:
Do not be mistaken and think that when external components are deleted, and doing a refresh of the service instances and executing the create smartobjects method will remove smartobjects that is to be deleted. Use the generate smartobjects method to help verify whether any smartobjects are to be deleted. Hope this helps someone!