• Noviski, Rodolfo
  • NEWBIE
  • 5 Points
  • Member since 2015
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hello guys,

Someone is using DevOps to implement the changes in each environment.
I have an environment with Git and Jenkins.

Any ideas or concerns?

Best regards
Rodolfo Noviski
Hello guys
I'm trying to sync the native android app using salesforce sdk mobile but when I use the following method:
public static void syncAccountUp(Account account,SyncManager.SyncUpdateCallback callback ) throws JSONException {
        Map<String,Object> objectMap = new HashMap<String,Object>();

        objectMap.put(Account.ID,account.getId());
        objectMap.put(Account.NAME,account.getName());
        objectMap.put(Account.ACCOUNT_NUMBER,account.getAccountNumer());
        objectMap.put(Account.TYPE,account.getType());

        JSONObject object = new JSONObject(objectMap);
        smartStore.upsert(Account.SOBJETCNAME,object);
        SyncUpTarget target = new SyncUpTarget();

        SyncOptions options = SyncOptions.optionsForSyncUp(Account.lstFields, SyncState.MergeMode.OVERWRITE);
        syncManager.syncUp(target.fromJSON(object),options,Account.SOBJETCNAME,callback);
    }



I get this error: com.salesforce.androidsdk.smartstore.store.SmartSqlHelper $ SmartSqlException: Account does not have an index on __local__

Has anyone ever experienced this?

Best regards
Rodolfo Noviski
Hello
How do I configure the default product tab in salesforce1?
This object does not appear in the application navigation list.

Best regards
Rodolfo Noviski
I've created a simple apex REST web service which I can call successfully from Workbench. I would like to call it from POSTMAN to test an external call. I try to do this but get an error:

[
  {
    "message": "Session expired or invalid",
    "errorCode": "INVALID_SESSION_ID"
  }
]

How do I get the session Id? And why is a session Id necessary for a call to a web service? What if an application is executing externally, and needs to make a call to this web service... Does it need to obtain a session Id before the call?

Thanks in advance for any guidance
David
Hello,

We are having an issue connecting one of our external applications (SAP PI) to our Sandbox environment using SOAP API.
When the authentication request is sent, the response is successfully returned. Then, when we try to send another request to retrieve updated Contacts, we are receiving the following message in the external application :

Error message
When checking the report showing API calls the last 7 days, I see that only one call is added to the Calls count (instead of 2).

Is it possible to monitor with more details the API calls received by SFDC ?
As the error says : Connection closed by remote host, could the external application be denied access to SFDC ?

Best Regards
global class Cmanfuct  {
        static string receiveToken(){
        system.debug('hit test');
        HttpRequest req = new HttpRequest();
        Http http = new Http();
        string endPoint;
        string client_id;
        string client_secret;
        if(!Test.isRunningTest()){
            CSS_Integration_Details__c recIntDetails = new CSS_Integration_Details__c();
            recIntDetails = CSS_getConnnectionDetails.getConnection('OAGOAuth');
            endPoint = recIntDetails.End_Point__c;
            client_id = recIntDetails.Username__c;  
            client_secret = recIntDetails.Passcode__c;
        }
        else{
            endPoint = 'https://abc.com/set';
            client_id = 'deerrr34';
            client_secret = 'wertyyy';
        }
        req.setEndpoint(endPoint);
        req.setMethod('POST');
        req.setHeader('Content-Type','application/x-www-form-urlencoded');
        req.setBody('grant_type=client_credentials&client_id='+client_id+'&client_secret='+client_secret+'&scope=CSSCloud');
      
        HttpResponse res = http.send(req);
       
        string jSONRequestBody = res.getBody();
        CSS_J2AToken_SRT wo1 = (CSS_J2AToken_SRT)JSON.deserializeStrict(jSONRequestBody,CSS_J2AToken_SRT.class);
        string accessToken = wo1.access_token;
        System.debug('BODY: '+res.getBody()); 
        System.debug('Status: '+res.getStatus());
        System.debug('Status Code: '+res.getStatusCode());
        return accessToken;
    }

   webservice static void sendClaimInfoToRSW(CSS_Job_Order__c recSJob){
      
       string jSONResponseBody = '';
       string cInfoRequest ='';
        try{
            string accessToken=receiveToken();
           
            System.debug('The cInfoRequest is***'+accessToken);
            String ServiceProviderCode;
            String DSID;
            String RONumber;
            String ESN;
            Decimal FailurePoint;
            String FailureMeasure;
            Datetime dtFailureDate;
            String FailureDate;
            Datetime dtWarrantyStartDate;
            string WarrantyStartDate;
            String Make;
            String Model;
            String Application;
            String VIN;
            String UnitNumber;
            String ServiceProviderContact;
            String CustomerName;
            String ComplaintCode;
           
            system.debug('recSJob.Creator_Location__c'+recSJob.Creator_Location__c);
            if(recSJob.Creator_Location__c != null){
            ServiceProviderCode = recSJob.Creator_Location__c.substring(recSJob.Creator_Location__c.indexOf('-')+1);
            }else{ ServiceProviderCode = ''; }
           
            system.debug('ServiceProviderCode'+ServiceProviderCode);
            if(recSJob.DSID__c != null ) {
                DSID = recSJob.DSID__c; } else { DSID = '';}
           
            if(recSJob.Shop_Work_Order__c != null )
            { RONumber = recSJob.Shop_Work_Order__c; } else { RONumber='';}
           
            if(recSJob.ESN__c != null ){
                ESN = recSJob.ESN__c; } else { ESN = ''; }
           
            if (recSJob.Failure_Point__c != null ) {
                FailurePoint = recSJob.Failure_Point__c; } else { FailurePoint = 0; }
           
            if(recSJob.Failure_Point_Measure__c=='Miles'){
                FailureMeasure = 'MI';
            } else if(recSJob.Failure_Point_Measure__c=='Kilometers'){
                FailureMeasure = 'KM';
            } else {
                FailureMeasure = 'HR';
            }
               
            if(recSJob.Failure_Date__c != null ){
                dtFailureDate = datetime.newInstance(recSJob.Failure_Date__c.year(), recSJob.Failure_Date__c.month(),recSJob.Failure_Date__c.day());
                FailureDate = dtFailureDate.format('YYYY-MM-dd') +'T00:00:00';     
            } else { FailureDate = ''; } 

            system.debug('FailureDate'+FailureDate);
           
            if(recSJob.Warranty_Start_Date__c != null ){
                dtWarrantyStartDate= datetime.newInstance(recSJob.Warranty_Start_Date__c.year(), recSJob.Warranty_Start_Date__c.month(),recSJob.Warranty_Start_Date__c.day());
                WarrantyStartDate=dtWarrantyStartDate.format('YYYY-MM-dd') +'T00:00:00';   
            } else { WarrantyStartDate = ''; }

            system.debug('WarrantyStartDate'+WarrantyStartDate);
           
            if(recSJob.Make__c != null ) {
                Make= recSJob.Make__c; } else { make = ''; }
            if(recSJob.Model__c != null || recSJob.Model__c != '') {
                Model= recSJob.Model__c; } else { Model= ''; }

            //String Application= recSJob.Application__c;
            if(recSJob.Application__c != null ) {
                Application = css_utility.getCodes('Application Code', recSJob.Application__c, null, null);
            } else { Application = ''; }
           
            system.debug('recSJob.VIN__c'+recSJob.VIN__c);
            if(recSJob.VIN__c != null ){
                VIN = recSJob.VIN__c; } else {
                    system.debug('VIN'+VIN);
                    VIN = ''; }
           
            if(recSJob.Unit_Number__c != null ){
                UnitNumber = recSJob.Unit_Number__c; } else {UnitNumber = '';}
           
            ServiceProviderContact = userinfo.getName();
            system.debug('ServiceProviderContact'+ServiceProviderContact);
           
            if(recSJob.Customer_Name__c != null ) {
                CustomerName = recSJob.Customer_Name__c; } else { CustomerName = ''; }

            if(recSJob.Category__c!= null ){
            ComplaintCode = css_utility.getCodes('Complaint Codes', recSJob.Category__c, recSJob.Complaint_Type__c, null);
            } else { ComplaintCode = ''; }  
            system.debug('ComplaintCode'+ComplaintCode);
           
            String JobId= recSJob.name;
          
            String UserId=  css_utility.getFederationId(UserInfo.getUserId()).toUpperCase();  //'OD324'; // User Id sould be in Upper case
            system.debug('UserId'+UserId);
           
            HttpRequest req = new HttpRequest();
           
            req.setEndpoint(CSS_getConnnectionDetails.getConnection('RSWClaim').End_Point__c);
            req.setHeader('Content-Type','application/json');
            req.setHeader('Authorization', 'Bearer '+accessToken);
            cInfoRequest= '{"Header":{"Sender":{"MessageID": "unique message ID at SF","SenderID": "SF","ServiceName": "ServiceRequest"},"Target":{"TargetID":"RSW"}},';
            cInfoRequest= cInfoRequest + '"DataArea": { "ClaimInformation": { "ServiceProviderCode": "'+ServiceProviderCode+'", "DSID": "'+DSID+' ", "RONumber": "'+RONumber+'", "ESN": ';
            cInfoRequest= cInfoRequest + '"'+ESN+'", "FailurePoint": "'+FailurePoint+'", "FailureMeasure": "'+FailureMeasure+'", "FailureDate": "'+FailureDate+'", ';
            cInfoRequest= cInfoRequest + '"WarrantyStartDate": "'+WarrantyStartDate+'", "Manufacturer": "'+Make+'", "Model": "'+Model+'", "Application": "'+Application+'", ';
            cInfoRequest= cInfoRequest + '"VIN": "'+VIN+'", "UnitNumber": "'+UnitNumber+'", "ServiceProviderContact": "CMARINE", "CustomerName": "'+CustomerName+'", ';
            cInfoRequest= cInfoRequest + '"ComplaintCode": "'+ComplaintCode+'", "JobId": "'+JobId+'", "UserId": "'+UserId+'" } } }';

            System.debug('The Claim Request is***'+ cInfoRequest );
            req.setBody(cInfoRequest);
            req.setMethod('POST');
            Http http = new Http();   
            HTTPResponse res = http.send(req);
            jSONResponseBody = res.getBody();
            if(jSONResponseBody.contains('ERROR')){
                System.debug('Incorrect json format');
                System.debug('BODY: '+res.getBody());
                System.debug('STATUS:'+res.getStatus());
                System.debug('STATUS_CODE:'+res.getStatusCode());
                css_utility.LogOutIntError(cInfoRequest, 'CSS Error:' + 'External Service Error',jSONResponseBody,'RSWClaimInfo');
            } else if(jSONResponseBody.contains('DEVELOPMENT MESSAGE')) {
                css_utility.LogOutIntError(cInfoRequest, 'CSS Error:' + 'External Token Error',jSONResponseBody,'RSWClaimInfo');
            } else {
                // Success
                System.debug('BODY: '+res.getBody());
                System.debug('STATUS:'+res.getStatus());
                System.debug('STATUS_CODE:'+res.getStatusCode());
            }
        }
        catch(exception e){
            system.debug(e.getMessage());
            css_utility.LogOutIntError(cInfoRequest, 'CSS Error:' + e.getMessage(),jSONResponseBody,'RSWClaimInfo');
        }
    }
}
Can anyone hele me ?
I have encountered a problem about rest api callout.
I have created a Apex Class annotated with '@RestResource',when a post request is recieved,I want to send a request to a third-party system via soap api(Callout),and after I recieved the response from this third party system,then make a response to the origin post request with the result responsed from the lately third party system,is it possible? Or how can I achieve this goal in another way?