| | |
| | | successStatus : 'success', |
| | | failStatus : 'fail', |
| | | insertCalloutLog:function(module,url,request,response,status){ |
| | | if(AWSService.sfSessionId){ |
| | | if(AWSService.sfSessionId&&false){ |
| | | sforce.connection.sessionId = AWSService.sfSessionId; |
| | | let transLog = new sforce.SObject('Transaction_Log__c'); |
| | | transLog.AWS_Data_Id__c = ''; |
| | | transLog.Module__c = module; |
| | | transLog.Interface_URL__c = url; |
| | | transLog.Request__c = request; |
| | | transLog.Response__c = response; |
| | | transLog.Request__c = ''; |
| | | transLog.Response__c = ''; |
| | | transLog.Status__c = status; |
| | | let insertLogResult = sforce.connection.create([transLog]); |
| | | if(insertLogResult[0].getBoolean(AWSService.successStatus)) { |
| | |
| | | }, |
| | | |
| | | //update |
| | | post:function(postURL, payloadForNewPI, callback, token) { |
| | | post:function(postURL, payloadForNewPI, callback, token,callbackError) { |
| | | console.log('Process New PI Data'); |
| | | console.log(JSON.stringify(payloadForNewPI)); |
| | | |
| | |
| | | }, |
| | | error: function (error){ |
| | | AWSService.insertCalloutLog(AWSService.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(error),AWSService.failStatus); |
| | | console.log(error); |
| | | if(callbackError) callbackError(error); |
| | | console.log(JSON.stringify(error)); |
| | | } |
| | | }; |
| | | if (payloadstr) { |