08-23-2013 06:32 AM - edited 08-23-2013 06:32 AM
Can anyone recommend a tutorial or code sample location to demonstrate tapping into the Save event for a View in SlxMobile 2.0 for 7.5.4?
I have a view that, when saving a change to a property on Opportunity, needs to communicate with a web service. I can put together the web service post code already, but I am not sure how to wire it up so that it is called when the user clicks Save in the toolbar.
10-07-2013 04:20 PM - edited 10-07-2013 04:22 PM
In your edit view, you can override the base SDK Edit's save:
save: function() {
this.inherited(arguments);
// Your webservice code here
}
EDIT:
If you need to ensure the data has updated/inserted correctly, you can instead override onInsertSuccess or onUpdateSuccess instead.
12-12-2013 11:11 AM - edited 12-12-2013 11:17 AM
Thanks. Is this the right place to extend the Account save code, for example?
In our web implementation we have combined the Insert Account/Contact pages so that a primary Contact is created when an account is made. In Mobile this doesnt happen. I wanted to extend the Account save function to create the dependent record.
I think we can use OnInsertSuccess, but wondring if there's a better place/way to do this. Thanks.
12-12-2013 12:29 PM
The SDK's edit view publishes a global pub/sub event when an insert or update occurs:
https://github.com/Saleslogix/argos-sdk/blob/develop/src/Edit.js#L1075
You can subscribe to this event in your case.