Page 1 of 1

Calling service inside mapping to return another value

Posted: Tue Oct 20, 2015 1:12 pm
by Kinson Sa

Dear friends,

Let see if some one have some idea for the problem I have.

I have service that return to me a code for a product. I need to show also the name, as it is not in the same data-base.

So in the mapping I put this JS.

Code: Select all

 Apperyio.storage.SUBFAM.set(value.substring(0,6)); 

  nombre.execute({}); 

 return value + Apperyio.storage.GET_SUBFAM.get();  

Where SUBFAM is the code I send to nombre.
Then the service nombre I mapping the result to GET_SUBFAM.

So I return the value + de the name I get.

It nearly works the main problem is that when it execute nombre the service works but not arrive to on success. so it continue with return, then after sending all the value to nombre, it start doing all success events of nombre.

Image Image Image


Calling service inside mapping to return another value

Posted: Tue Oct 20, 2015 8:38 pm
by Serhii Kulibaba

Hello,

It is not good solution to use service in the mapping. Especially which uses Storage variables. It connected with delay of the service's response before it's usage in the JS mapping.