I have an app where I need to update a to-do object containing a few basic fields. I have a text input, a date input, a text area field and a selector on my detail screen. I have it setup with a master-detail where I have the object id saved in a local storage variable. Below are a couple screen shots of my field mapping on the request side of the update service. However, when I change the value of a field and invoke the service, it is not completing. Any help would be appreciated.
I am invoking the service on click of a save button and have it set up to navigate back to my master page upon successful update.
It doesn't complete and just stays on this page.
Why don't you put in an event handler on the service for error. My guess is there is an error in the communication.
You can see that by getting into the debugger in the browser (Like in Chrome, right-click and select Inspect Element). Click on the Network tab and reload your app. See what the happens on the call of the service.
Let us know what you see.
The update is failing returning Row not found. Take a look at the AppServer logs and see if there is any clue there.
This is not an OE object, it is a native rollbase object that I am trying to update. I checked the logs in Rollbase and couldn't find anything there that helps me.
Any other ideas on this one?
In your first screen shot, it looks like you do have the request "id" mapped to a local storage variable.
But did you verify that the local storage variable has a valid object id?
Have you tried using the debugger in the browser (Like in Chrome, right-click and select Inspect Element). Click on the Sources tab. On left hand-side, click on views/assets/js rollbase/jsdo -> progress.mobile.3.0.js. Code should be displayed on right-hand side. Put a breakpoint in JSDOUpdateImpl in this.process() function, rerun, and walk through code. In that function, you'll see code that throws error "Row not found". Maybe your JSDO memory no longer has that row loaded??
I am no expert with Rollbase as the backend for Mobile and I usually use OpenEdge .. With that said, I have to pass _id to the record being updated for an update to happen. My suggestion is for you to store the _id for the record you want to update on a LocalStorageVariable and map that variable to _id when calling the UpdateService.
If you wish, send an email to rperdiga@progress and I can also take a look at your project with you ...
I think you're correct, Ricardo. I'm no Rollbase expert either, but in the JSDOUpdateImpl code, it does reference the _id, as below, and passes that to JSDO code..
var theid = datarec._id;