Skip to main content

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 .

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.


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


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.


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"));

 

 


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