0

I had customized work execution app of Maximo Anywhere and created new view of Service Request. But I am unable to save the new record back into maximo. The record is saved in mobile and visible upon refresh but not updating in maximo. whereas other work order related views are able to save the records. Here is my code of Handler script to save the record.

        _saveTransaction: function(){
        try{
        var serviceRequestSet = this.application.getResource('serviceRequest');
            var serviceRequest = serviceRequestSet.getCurrentRecord();
            if (serviceRequest.isNew()) {
                //alert(serviceRequest.get("description"));
                ModelService.save(serviceRequestSet);
            }           
            this.ui.hideCurrentView();
        }catch(e){
            alert(e);
            throw e;
        }
    },

am I missing some steps?

max75
  • 13
  • 5

1 Answers1

0

Can you make sure in a then and otherwise block that this save is going through successfully?

For example:

ModelService.save(serviceRequestSet).
then(function(result) {
      Logger.trace('ServiceRequestSet saved: ' + result);
}).
otherwise(function (result) {
      Logger.trace('ServiceRequestSet not saved: ' + result);
});
scott dickerson
  • 908
  • 1
  • 5
  • 13
  • Yes, it is saving in my phone but not updating back in maximo. Even if I logout and re-login it shows my record in simulator phone and its not updating in maximo. – max75 May 03 '15 at 07:41
  • Look for an "updatePayload" method in your javascript console https://developer.chrome.com/devtools/docs/console You should see an attempt to upload this record to the backend maximo server through the OSLC adapter. You might also try searching for an insert in the console log. Are there any other errors in the console log? – scott dickerson May 04 '15 at 19:46