How to update a DB field with K2?

  • 16 April 2015
  • 5 replies
  • 5 views

Userlevel 3
Badge +16

Hi all,

 

Up till now, we've used K2 smartforms to create online forms for users to fill in and that has been great....but i've been asked to broaden our K2 use to do the following tasks to do with systems such as Microsoft SCSM (System Centre Service Manager) or even Sharepoint.

 

1) How do i get K2 to update fields in a Database which isn't a Smartobject? Such as a SQL Database/Table on a non-K2 Windows Server.

It is easy to read, update K2 Tables when using forms, but can anyone please help me get started with an example on how to update a table elsewhere?

 

2) I've been asked to make a form which passes data from a Sharepoint page into the k2 Smartform, any ideas on how i even begin to do this?

 

As always, you guys are great and I really don't know what i'd do without this forum.

I do not have the K2 for Sharepoint plugin installed, is this needed to achieve the above?

 

Thanks as always.


5 replies

Badge +8

Updating a database table is as simple as creating a new SmartObject for the table.  Using the SmartObject Service Tester, you create a service object for your database.  Then creating a SmartObject for the table is as simple as right-clicking on the table.  See JohanL's post here for more details.

Userlevel 3
Badge +16

Hi,

 

1) I created a SQL database and table on a seperate SQL Server

 

2) I am getting a Validation Error Login failed for user XXXXXXXXXXXXXX when trying to add a new SQL Server Service in Workspace.

 

In the Service Instance Configuration i have set the following:

 

On different Sql server = true

i set the correct db and server

set native sql execution to false

 

Auth mode = static

entered username and password

 

My user is a Windows user with full permissions on the DB

 

But still won't login when trying to add the service instance.

 

Any ideas?

 

Userlevel 3
Badge +16

Managed to get past this error using a static LOCAL SQL account with DB_dbreader rights....

 

However, when i've added a Smartobject and connected it to the newly created SQl Service and created the form and views, I get this error when running it:

 

"user does not have permission to perform this acttion"

 

The default method is list

 

Any ideas?

Userlevel 5
Badge +18

I believe Static authentication refers to the usage of a SQL login; assuming the SQL server have been configured for both Windows and SQL logins.


 


One more thing that you can try is to change it to Service Account authentication, and then give the K2 service account dbo to the specified SQL database.

Userlevel 3
Badge +16

Thanks for your help.

 

Was a permissions issue, the serviceaccount wasn't added to login security on the sql server.

Added permissions and works ok using serviceaccount option now.

 

Thanks again

Reply