K2 SmartForm, Checkbox ticks are not saving when clicking button

  • 10 March 2015
  • 5 replies
  • 16 views

Badge +3

HI,

 

I have a created a smart object and view using that smart object for my checkboxes and have been passing the values in my smartobject in the rules.

 

I have attached the rules below.

 

When I tick the check boxes and then click on the button called 'master_save' it starts the workflow and when the form arrives to me and when I open the form, the form has no check boxes ticked. It doesn't save and capture any changes made by the person who created the form.

 

Can someone please help me?


11045i5F4D03F874E32DC6.png
13186iEA353EF0C05FC9DF.png
12347i51523FF275021E54.png
11688i663C4D4BE799F7B1.png

5 replies

Userlevel 5
Badge +16

Dear,

 

 

try to use the "Execute a smartobject method" insead of "Execute a method on the view" 

try to make the rules in the "master-save" event to run as "One after another" instead of "In a batch"

 

How do you attempt to load the saved values of the checkbox list? Please let me know!

 

 

Badge +3

Hi,

 

I tried your suggestion and it still doesn't work.

 

:(

 

I have attached the rules again.


14307i274CDF4F2CB33793.png
16412i941F60B255EA07C0.png
Userlevel 1
Badge +8

Hi Anne

 

There are a few issues you need consider.

 

Saving of the  selected checkbox list values

 

When you click the "master_save" button you need to save the selected values from the checkbox list. It looks like you may be doing this when you call the Create method on the rule. This will save the selected checkbox values into a multivalue smartobject field. 

 

Starting the Workflow

 

You need to let the workflow know which SmartObject record you have just saved so that it can tell the task form what data to display. You can do this a couple of ways - passing the SmartObject ID into the workflow as a data field or using an item reference. If you pass the ID as a data field you will need to map the return ID parameter from your create method into a field on the form or just into the views smartobject (if your view is using the smartobject as a datasource) in order to have access to this value and pass to the workflow.

 

Displaying of the selected values in the task form

 

When you open the task form you need to execute the smartobject read method (or view read method) and pass the saved value (as above) into the checkbox list. This will check the selected values. This is usually done on the form initialize rule. You will need to pass to the form the ID for the smartobject record you saved above in order to perform the read. This can be done a number of ways - form parameter, passing into a form/view field, using item references.

 

If you need some further help with integrating forms and workflows I suggest you look at some of the videos on http://www.k2.com/resources/product-demos

 

Badge +3

Thanks so much Andrew. I will go through the videos, I think the problem is with my SmartObject. :)

 

 

Userlevel 4
Badge +13

Hi AnneG,


 


As a test you can create a brand new SmartObject with two properties:


ID - Autonumber


Checkbox - Yes/No


 


Then generate a View from the newly created SmartObject (ensure that there is a save button that when clicked will save the ID textbox and checkbox values to the SmartObject) and give it a test run.


 


If this works as expected, then the issue is originating from within your form or smartobject, in which case I would suggest confirming that all the smartobject properties as configured with the correct Data Type which will resemble that data it would be recieving and also confirm that on your formview has a rule configured to the save button that is actually saving the data from the controls to the smartobject.


 


Kind Regards,


Raymond

Reply