AhmadAbdullah
Apprentice

Generate Editable List off of SQL Stored Procedures

Dear ,

 

I faced a problem when i had a requirment that needs my List view to become editable list , and since my SP is a "SELECT" it will only be able to generate "List View"

so i found a way that might be interesting for all users that needs to use Stored procedures and generate editable lists ,

 

I created simple table , and 2 simple stored procedures , 1 for getting all employees , 2 is for updating employees

 

3871i1E1B6E0A46F55DF7.png

3873i2AC65BFCE25D1448.png

 

Right click on the get SP , and click on edit , then navigate to Methods Tab

Note: other way is to create NEW SMO via k2 designer , and use these 2 SP's SMO's as methods inside the new SMO but in this way u will need to configure its attriibutes , but u could accomplish all with the same steps .

3875i0296DFA562B46B51.png

 

Click on next and follow the next figures ,

Make sure to bind the fields .

3877i03E04433692A687D.png

 

Might be a long step by step , but hope it helps !

Note: this editable list will be able to show employees and update them , if u need it to "ADD" new employees u will need to create "INSERT" stored procedure and follow same steps to add the "INSERT" SP into the SMO Methods tab .

Best Regards.

AhmadYaqub.

0 Kudos
Reply
1 Reply
ScottPK2
Apprentice

Re: Generate Editable List off of SQL Stored Procedures

Also, if you want to step away from the web based designer and edit your smart objects in a thick client you can actually go in and change the execution type of the methods and tag them as their appropriate operations. For example if you have a stored procedure that is uspCreateUser and another that is uspUpdateUser and those both end up being exposed as methods of type list, you can go in after you have configured the methods and change the method type to correspond to the procedures intended use. It will make K2 treat them as intended when created views and the like.

 

3968iF966A7E3EAF6A16D.png

0 Kudos
Reply