Best practice for offline mode forms/workflows saving master-detail stuff


Badge +1

I have a specific use-case in Mobile offline involving workflow that I could use some help with.

 

Imagine I have a form with basic header information.

Then I have a detail section where the user can attach multiple pictures.

This form is to operate offline.

 

When trying to save the master/detail stuff from smartforms and then starting the workflow, I have no way of getting the primary key of the smart box save I just did.  This is all in batch mode.  If I try to start the workflow and pass the form data to the workflow via fields, I can save the master information, server side in the workflow to get the primary key back, but how do I handle the images?  I tried to pass the image to a process data field and then save the detail record to the smartbox, but it doesn't seem to save correctly as an image.

 

I wish I could just do this master header/detail save in the smartforms, but I don't get the key back.

Anybody else run into this issue?  How do you handle it?  How do I handle images when passing it from the form to the K2 blackpearl workflow?

 

I hope my scenario is clear.  I can try to clear up anything needed.

 

Thanks.

Hao Ngo

 


3 replies

Hi, The best way to storing master, detail data in offline experience is by generating a uniqe identifer as soon as the form loads and use that to store the data.

 

it's a good idea to use a GUID as the primary key in this scenarios to avoid duplicate id's. 

 

I hope this helps

Badge +3

Do you have to set up your table differently to do this?  When using the Create method (I have everything setup using CRUD), I don't get the option to set the ID field.

Hello,


 


Here is a vast amount of information regarding Offline mode forms/workflows. Also depending on what version of K2 you are using, I have referenced other guides as well.


 


Documentation:


http://help.k2.com/onlinehelp/k2smartforms/userguide/4.7/default.htm#application_and_offline_forms.htm


http://help.k2.com/onlinehelp/k2cloud/userguide/update_4/default.htm#create/forms/offlineavailability.htm


http://help.k2.com/onlinehelp/k2cloud/userguide/update_4/default.htm#create/k2designer/controls/supportforofflineforms.htm


http://help.k2.com/download/offlineforms


 


Additional Documentation:


https://help.k2.com/onlinehelp/k2five/userguide/5.0/default.htm#Create/K2Designer/Rules/CreatingRules.htm%3FTocPath%3DCreate%7CSmartForms%7CViews%7CRules%7C_____2


 


Also, if you do need assistance in helping configure your offline forms or rules or have a lot of additional questions, Remote Mentoring would be a good path to take.

Reply