Having K2 uncheck all items in a Choice field

  • 11 September 2014
  • 2 replies
  • 4 views

Badge +10

Hi All,

 

I'm using the SharePoint Content broker to connect to a SharePoint site.

I have a custom list where I'm using a choice field displayed as checkboxes.

User can select more than one checkbox.

From a K2 smartform I'm giving the users the ability to check these boxes using the Choice control type.

The checking works and the changes reflect on SharePoint.

However, when a user unchecks all of the options, the K2 smartobject sees it as a blank value which causes the field not to be updated instead of having it uncheck everything.

I've tried passing an scnull to the field, but that results in an Object Reference error being generated.

I don't know what else to try, does anyone know how to get this working?

 

Basic recreation:

Create a new SharePoint custom list containing a choice field set as checkboxes. Ensure multiple items can be selected.

Create a new Service Instance from the SharePoint Content broker and point it to the SharePoint site containing the custom list.

Generate a smartobject from the custom list using the K2 smartobject Service Tester

You don't need a K2 smartform, you can test using the Tester.

Create a list item and supply one of the values for the multi select column.

View in SharePoint that the item is checked.

Now try to update that item by using the update method, but don't supply a value for the multi select column. 

See in SharePoint that the previous item is still checked.

 


2 replies

Badge +7

Hi JohanL,

 

This might be a silly question, but I was wondering if it would be acceptable or not. Have you considered creating an additional checkbox choice that just reads "None" or something like that? 

Badge +10

I think this might be the only easy way to fix this.

I've tried creating a blank option as well, but SharePoint ignores it.

I'll implement this in the meantime, but would still like to find out if there is another way.

 

Regards,

JohanL

Reply