Can someone save a partially completed form to submit later?

daveyk72
Kilo Contributor

Hi community,

I'm wondering if there is a way that someone can save a partially completed form and be able to submit at a later time?

It's not something we had developed during implementation a couple of months ago, so any assistance would be appreciated.

12 REPLIES 12

Hi Michael


When you call the script which i mentioned before update or insert, it would only clear the mandatory check at the time of update/insert. When form is reloaded all the mandatory checks would restored as they should.



In your case i guess you should call this function when state is not Closed Complete. In this case this script would run and clear mandatory fields for any other status before update/insert and would only prompt for mandatory fields when state is Closed Complete.



Hope this makes sense.



Cheers


Syed


I'm trying to implement the UI Policy like David O'Brien posted above.



If the State=Closed Complete, the mandatory fields are enforced. Otherwise, don't enforce the mandatory fields.



I have created a UI Policy with the condition: State --is-- Closed Complete


On load: checked


Reverse if false: checked



Execute if true:


function onCondition() {


  var manFields = g_form.getMissingFields();


  for(var i = 0; i < manFields.length; i++){


  g_form.setMandatory(manFields[i],true);


  }


}



Execute if false:


function onCondition() {


  var manFields = g_form.getMissingFields();


  for(var i = 0; i < manFields.length; i++){


  g_form.setMandatory(manFields[i],false);


  }


}



The issue is once the mandatory attribute has been cleared while the record is open, it remains cleared even if the State is changed to Closed Complete. The same is true even if I reverse everything above using State --is not-- Closed Complete.



I have also tried this in an onSubmit client script with the following script:



function onSubmit() {


  var currState = g_form.getValue('state');


  var manFields = g_form.getMissingFields();



  if (currState != 3) {


  for(var i = 0; i <manFields.length ; i++){


  g_form.setMandatory(manFields[i],false);


  }


  }


}



The issue here is that the system mandatory enforcement occurs before this Client Script is run.




Any suggestions on how to simply have the mandatory fields only enforced if the State is Closed Complete?


Hi Michael


The way i implemented this is as follows:



Created a UI Action, i.e 'Save as Draft'


Client = True


onclick= saveAsDraft()


Condition = current.canCreate() && current.state=='-1' // i.e. Not draft, you can use your condition i.e. not closed



function saveAsDraft() {


  ignoreMandatoryCheck();


  g_form.save();



}




function ignoreMandatoryCheck(){


      var i;


  var arrValues = g_form.getMissingFields().toString().split(',');


  // checking existence of value


  for (i=0;i<arrValues.length;i++){


  //alert(arrValues[i]);


  g_form.setMandatory(arrValues[i],false);


  }



}



Try this and share how you go.