Dear @CraigJB,
To achieve this you will need to :
1- Add the field you want to your database table
2- refresh the service instance
3- create smartobject But before publishing you have to change the name to the previous name of your old smartobject
4- there's a button called get existing GUID, when you press it notice that the GUID changed
5- Publish smartobject, it will show a popup to OVERWRITE the smartobject, click yes
this way it keeps the old smartobject and add the new fields you've added.
wish it helps
Regards
Hi Craig
Steve's suggestion will work well, however it will delete any associations you have on the SmartObject.
Another way to achieve this without deleting the associations is to edit the smartobject - although its a bit more time consuming.
- Create your new SQL table field and refresh the Service Instance
- Find the SmartObject in K2 Designer and click the edit button
- On the Properties tab click Add and add a new property to the SmartObject (call it the same as your new table field and give it the correct data type)
- On the Methods tab edit each of the methods to remap the properties to the table field (not required for delete) as follows:
- Select the method and click the Edit button
- Select the "Service object method binding" page
- Select the Service object method and click Edit
- Click the auto map button. This will remap all of the properties
- Save and repeat
I had a similar situation: an MSSQL view that was the source for the SmartObject (obviously meant to be read-only object). However, I also had a handful of MSSQL stored procedures that were table-value returning select statements (with a join here and there and/or a few inline string processing functions on some of the columns) that were mapped as custom SmartObject Methods. While the publishing technique as described in the accepted answer worked, it wiped out the custom method mappings, leaving me with only the default standard List method (a "select * from" the source view).
Is there some way to preserve those custom method mappings? Or is it necessary to re-map all custom methods after such a re-publish?
- Justin
Hi jwarwick
See my post above (in this thread) for instructions on how to edit a smartobject after a table definition change to preserve custom methods.