Hey, I am trying to create a custom process on Net...
# suitescript
r
Hey, I am trying to create a custom process on Netsuite WWS mobile App. I configured a custom mobile action of type Restlet. But I am not able to figure out the part to store response in the state. I want to use some value from the response to set a field on the page. I was able to successfully call the RL on page load event. But not sure the part to configure output parameters to set the state. 🆘
m
By set the state do you mean update value on the page? Or do you mean you want to store it in a session variable?
r
Eventually, I want to set the value of a field on the page. From docs, I thought that first we need to store that in session state of the App which app mantains.
m
Depends on what you need. If you want to save into session you need to call back to the server and store using something like. In an SS2 service you would do something like this.
Copy code
var current_session = runtime.getCurrentSession();
current_session.set("property", value);
If you want to update the page you would set the value on the view or modal then call
this.render()
which my understanding calls
getContext
and would update the template with the latest variables that are returned in that function.
r
Hmm, Thanks. But I think we have way of doing it already.
👍 1
When we create a RL mobile action it has input and output parameters.
We setup output parameters correctly and then it should store data into the state.
But my setup is not working. I am missing something and lack of documentation is making it hard to figure out.