mobilemovilizer

Movilizer - Client just stops executing the method after calling queryMasterData


I want to get some results from MasterData with a query. I see no errors or something else whats so ever. The debugger just stops at queryMasterData. No results are shown.

The function i am calling:

$local:getSparepartsSearch = function(searchString)
{
  pool = $masterdata:'com.movilizer.bottler.sparepartresources.location.99.employee.S031';
  group = "ALL";

  filter = {
    'col' : 'key';
    'op' : 'startswith';
    'val' : searchString;
  };

  returnArray = {
    'result' : 'all';
    'order' : {
        'key' : 'A';
    };
    'limit' : 1000;
    'offset' : 0;
  };

  spareparts = queryMasterData(pool, group, filter, returnArray);
  for(i:spareparts)
  {
    sparepartData = spareparts[i]['data'];

    for(j:sparepartData)
    {
        key = j;
        value = sparepartData[j];
        result[i][key] = value;
    }
  }
  return result;
};

Solution

  • could you please add more information, how does your movelet look like? Which screenTypes are you using and how are you trying to display the data (screen changes or change events)?

    I had a look into workspace to find a closer example, in the past I've created a zip code search by an existing pool of zip codes. In my example I've used an text item screen which returned me the matching numbers with the start value of at least 2 digits.

    if(length(value) ?ge 2)
    

    { addAnswer($answer:'q0a1', '0', 'Output: ');

    pool = $masterData:'PostCode';
    group = 'FrenchDealer';
    filter = 
    {
        'col':'key';
        'op':'startswith';
        'val':value;
    };
    
    keyword = queryMasterdata(pool, group, filter,{ "result":"all";});
    
    for(i:keyword)
    {
        for(j:keyword[i]['data'])
        {
            addAnswerItem($answer:'q0a1', '0', '0', j, conCat(keyword[i]['data'][j]['CITY'], '(', keyword[i]['data'][j]['COMMUNE'], ')'));
        }
    
        addAnswer($answer:'q0a3', '0', 'matched:');
    
        str = conCat(i, '\n', str);
        setAnswerValueByClientKey($answer:'q0a3', '0', str);
    }
    
    $local:addedDropDown = true;
    

    }