Solved

FSM Mobile - data reflection in back office

  • 15 May 2020
  • 5 replies
  • 212 views

Userlevel 3
Badge +6

hi can anyone tell how to reflect the data to smart client or back office .

i am wrote a script for mobile using the

 setdbvalue(stringformat(“update person set user_def12=’{0}’ where peron_id =’{1}’”,y,personid));

here y and personid is parameters that i am passing .

the script executes but the data is not reflected in back office or smart client  , so anyone tell me how this can be archived .

thanks in advance .

icon

Best answer by Chandima Athukorala 9 June 2020, 17:59

View original

5 replies

Userlevel 3
Badge +6

If you need to reflect changes to back office  from the mobile you should  use to  saveDataTransaction function to do so. In script  documentation , you would see “Example 10—Script-Based Transaction” which may help you on your request.

Userlevel 3
Badge +6

thanks for your response , can you  share the script document .

Userlevel 3
Badge +6

you can  open documentation when you go to custom script window under smart client.  Click ok help icon on top right corner with sign (?). Then it should open up Script documentation.

Userlevel 3
Badge +6

can u tell me , what is the error “incorrect datatype” for .

here is the code 

var personId = getUserInfo("PersonID");
var Y = 'Y';

var rowId = getDBValue(stringFormat("select metrix_row_id from person where person_id = ''",personId ));
var taskTrans = generateDataTransaction("person", "UPDATE", stringFormat("metrix_row_id = ", rowId));
taskTrans = addToDataTransaction(taskTrans, "metrix_row_id", rowId);
taskTrans = addToDataTransaction(taskTrans, "person_id", personId);
taskTrans = addToDataTransaction(taskTrans, "user_def11", Y);


saveDataTransaction(taskTrans, getMessage("person", "LABEL"));

 

 

Userlevel 3
Badge +6

Muthu, as a developer first you need to find which row that give thia error and correct  it for syntax. If I test  something  best way to put alert msg  after each line and check which line has issue. Do it that way find this erroneous  syntax.  One final hint , to eliminate syntax errors you should first check this using Run button in Client Script Window.(then  you can easily identify syntax errors! )

Reply