Skip to main content
Question

Problema ao Salvar informações ao utilizar populateListFromQuery

  • December 16, 2025
  • 1 reply
  • 7 views

prazz
Do Gooder (Employee)
Forum|alt.badge.img+1
  • Do Gooder (Employee)

Hello everyone,

I have the following problem in FSM Mobile: when using the function populateListFromQuery, the list is filtered as expected, but when saving the information, the field does not save the selected value. I imagine that when performing the filtering, it must be somehow setting it as empty.

 

Is there a solution for this?

Script:

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

var tensao = getDBValue(stringFormat("select com_voltage from task where task_id ='{0}'",taskId));

if (tensao >= 4 || tensao <= 9){
    var query = "select code_value, description from global_code_table where code_name = 'C_CELESC_LACRE_LOCALIZACAO' and user_def1 ='A'";
    populateListFromQuery("c_task_lacres","c_localizacao_do_lacre",query,true);
} else if (tensao >= 1 || tensao <= 3){
    var query = "select code_value, description from global_code_table where code_name = 'C_CELESC_LACRE_LOCALIZACAO' and user_def1 ='B'";
    populateListFromQuery("c_task_lacres","c_localizacao_do_lacre",query,true);
}


 

1 reply

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • December 16, 2025

Hi ​@prazz 

Some details are missing.

  1. Which screen is it?
  2. When does the attached script run?
  3. Do you have an override/validation script for the save event?
  4. If you simply hard-code a value with ‘setControlValue(...), does it work?

Cheers!