Skip to main content

In FSM Mobile, we have Task Steps screen which is "List with CheckBox”.

Our requirement is to set the Steps to be completed when the screen is launched.

We are able to use “Populate Script” to populate the Completed flag, when the screen is opened.

But, when clicking on Next, the data doesn’t get saved.

Can you please assist in either handling the checkbox change event or in the NEXT button script to save the changes.

Hi @CKOppBox 

Can you please share your script and configurations?

First thing that comes in mind, are you using saveChanges();? At the end of your update script?

Cheers!


Hi @Shneor Cheshin,

Below is the Populate Sript

var taskId = getCurrentKeys("task", "task_id");

var taskStepCheck = "";

taskStepCheck = getDBValue(stringFormat("SELECT user_def5 FROM task WHERE task_id = '{0}'", taskId));



if (taskStepCheck == 'N' || isNullOrEmptyString(taskStepCheck)) {

    var listData = getCurrentListData();

    var listLength = listData.length;

    if (listLength > 0) {

        for (var i = 0; i < listLength; i++) {

            var row = getRowFromListData(listData, i);

            row = setValueOnListDataRow(row, "task_steps", "completed", 'Y');

            listData = setRowOnListData(listData, row, i);

        }

    }

    return listData;

}

and Using the below in the NEXT Script.

But, on Mobile, the above populate is not getting recognized & hence, showing the alert to “Populate all Fields”.

if (initialValuesHaveChanged()) {

    if (saveChanges()) {

        advanceWorkflow();

    }

} else {

    alert(getMessage("PopulateAllRequiredFields", "INFORMATION"));    

}

 


A “List with CheckBox” screen is not configurable.  It requires code to perform whatever action the checkbox is supposed to do.  If you have added a custom screen using the “List with Checkbox” Screen Type, you will need custom code for that screen to be able to do anything with the data.


Reply