Changing data source form SharePoint list to SQL table


Badge +3

Hello,

 

I have a running K2 solution that uses a SmartObject of a sharepoint list.

According to business needs, i had to export the sharepoint list data to SQl Server.

Is there a way to change the smartobject connection to read from SQL table without making any changes in the workflow or smartforms side ?


6 replies

Userlevel 5
Badge +16

Hi Eslam,


 


I haven't tested this but I believe this is possible by changing the service object method bindings.


 


Edit you smartobject in the designer or K2 studio, select a method and edit it


 


12588iFB368CB4AFAB12E2.png


 


then change the service object method


15718iA864707778269751.png

Badge +3

Hello Mustafa,

Thank you for the response,i've tried to change the service object method but actually the service object method is not editable  and can not be changed, only you can edit the the method properties but not the method itself.

Userlevel 5
Badge +18

I believe the Service object method itself is not editable from K2 Designer; this is how K2 "sees" this object from which ever back-ends it is; the edit will need to be made on the back-end.


 


So if the data source is now SQL instead of Sharepoint, was a SQL server service instance created?


http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#WS_SQL_01.html


 


If this list was recreated as a SQL table, usuallly the Table Service Object will have a list method that you can map to this get list item method.  Then the Smartobject Properties and Service Object properties will need to be mapped accordingly.


 

Badge +3

Hello tin,

 

I already have recreated  the lists as a SQL table and also created the SQL server service instance.

But i'm asking if there is a way to map the properties and methods of the sharepoint list smartobject and the SQL table smartobject ? so that i can reduce the amount of change that need to be applied to the workflow and the smartforms due to the change of the data source.

Userlevel 1
Badge +8

Yes, you can do it one of two ways. Either edit the smart object in the Web Designer or in a thick client designer. I actually prefer the 2nd method using the thick client designer due to the stability of the tool and you actually get to work with a physical file that you can make a backup of before making changes to give you an opportunity to roll back if necessary. The key here is to not change the method or properties names on the smart object itself. 

 

Launch K2 Studio or Visual Studio and start a new blank project. I would name the project the same name as the category where your smart object lives today if you want it to show up in the same place. It isn't critical as the category structure is purely to organize for human understanding and isn't referenced when the product is looking for a smart object. That is done by System Name and/or GUID of the SmO.

 

In the new blank project, you will open the K2 Object Browser, find the smart object you want to change, right click and choose Save to Local.

13242i217D0C70839F5F97.png

 

A couple of key points about this approach that makes it desirable is that you can:

  1. Make a copy of the SODX and put it in a safe place before you make changes. Making changes in the Web Designer updates your only copy so you mess up you are in trouble. Since you desire is to preserve the integrity of your solution while you make this change, having a back out plan is the way to go.
  2. The changes you are making to the SmO do not become available until you deploy. So your solution will continue to function normally using the SharePoint configuration until you deploy the changes you have made in the design tool.

I used to acutally mention and teach this capability in my training classes as it is good approach to map out a data structure if the actual data sources aren't readily available.

 

Hope this helps.

 

S.

Badge +3

Hello Scott ,

 

Thank you so much for your support and guidance.

As you said, there is another way to edit the smart object in the Web Designer, actually i'm trying to figure out how to do it but it seems not possible to edit it from the designer side. Could you please guide me through this ?

Thank you for the consideration.

 

Kind Regards,

Eslam Eissa

Reply