• veeranjaneyulu
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I have written one restapi post method class. when i am trying to execute this api class through workbench . i am facing below error please help me out.

restExplorer Url Mapping :"/services/data/apexrest/dpWebPlanChg1"





 
@RestResource(urlMapping='/dpWebPlanChg1/*')
global without sharing class DPWebPlanChange2017Dump {

public class DPWebPlanChange2017Exception extends Exception{}
    
@HttpPost
    global static DirectPayResponse getDPWebPlanChangeData(DPWebPlanChange directPlanTrackerVar) {
    
    
        
        DirectPayResponse plnChngRes = new DirectPayResponse();
        
        system.debug('....restResponse...'+plnChngRes);
        
        // Get Account details
        Account updateAcc = getMemberData(directPlanTrackerVar.ssn, directPlanTrackerVar.dob, directPlanTrackerVar.FName, directPlanTrackerVar.LName);
        if(updateAcc != null) {
            //Insert Direct pay Plan Change Tracker record along with old values of Account
            plnChngRes = createDirectPayTrackerRecord(directPlanTrackerVar, updateAcc, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                return plnChngRes;
            
            //Update Account only if it is Direct Pay
            //If a customer has enrolled for both Medicare and Direct Pay then that account will not be updated
            if(updateAcc.Medicare_Claim_Number_new__c == null){
                plnChngRes = updateDirectPayAccount(directPlanTrackerVar, updateAcc, plnChngRes);
                if(plnChngRes.result == 'ERROR')
                    return plnChngRes;
            }   
        } 
        
        //If Account not found
        else{
            //Insert Direct pay Plan Change Tracker record
            plnChngRes = createDirectPayTrackerRecord(directPlanTrackerVar, null, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                return plnChngRes;
            
            //Insert Account if not exists
            plnChngRes = insertDirectPayAccount(directPlanTrackerVar, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                    return plnChngRes;
        }

        //Insert Opportunity 
        plnChngRes = insertDirectPayOpportunity(directPlanTrackerVar, plnChngRes);
        if(plnChngRes.result == 'ERROR')
            return plnChngRes;

        
        //Update Direct pay Plan Change Tracker record with Opportunity and Account
        plnChngRes = updatePlanChangeTrackerRecord(plnChngRes);
        if(plnChngRes.result == 'ERROR')
            return plnChngRes;
        
        
        return plnChngRes;
    }

    //Get Account record based on DOB, SSN, First Name and Last Name
    private static Account getMemberData(String SSN, String dob, String firstName, String LastName) {
        Account accdata = new Account();
        try {
            accdata = [Select Id, Marital_Status__c, Primary_Language__c,Phone, PersonBirthdate,
                       PersonMobilePhone, PersonEmail, Physical_Address_Line_1__c, Medicare_Claim_Number_new__c,
                       Physical_City__c, Physical_State__c, Physical_Zip_Code__c, Mailing_State__c, 
                       Mailing_Address_Same_As_Home_Address__c, Mailing_Address_Line_1__c, Mailing_City__c,
                       Mailing_Zip_Code__c, Primary_care_physician_name__c, Physician_Address__c, Physician_State__c,
                       Physician_City_town__c, Physician_Zip_code__c FROM Account WHERE LastName = : LastName
                       AND FirstName = : firstName AND PersonBirthdate = : date.parse(dob) LIMIT 1];
        } 
        catch (Exception e) {
            system.debug('Exception Occured' + e.getMessage());
            return null;
        }
            return accdata; 
    }


Raw Response
HTTP/1.1 404 Not Found Date: Fri, 14 Oct 2016 07:17:44 GMT Set-Cookie: BrowserId=yTCuswHmRoKXZvYgWh5Zgw;Path=/;Domain=.salesforce.com;Expires=Tue, 13-Dec-2016 07:17:44 GMT Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked
[ { "errorCode" : "NOT_FOUND", "message" : "The requested resource does not exist" } ]


 

what is soap api , and rest api?

how will use the soap api and rest api?

what is bulk api ?

how will use the bulk api?

what is the system assert ? what is the system assert equal?

what is the different d/w both of them?

what  is transient keyword ....how to use in transient key word in salesforce

 

Hi,

I have written one restapi post method class. when i am trying to execute this api class through workbench . i am facing below error please help me out.

restExplorer Url Mapping :"/services/data/apexrest/dpWebPlanChg1"





 
@RestResource(urlMapping='/dpWebPlanChg1/*')
global without sharing class DPWebPlanChange2017Dump {

public class DPWebPlanChange2017Exception extends Exception{}
    
@HttpPost
    global static DirectPayResponse getDPWebPlanChangeData(DPWebPlanChange directPlanTrackerVar) {
    
    
        
        DirectPayResponse plnChngRes = new DirectPayResponse();
        
        system.debug('....restResponse...'+plnChngRes);
        
        // Get Account details
        Account updateAcc = getMemberData(directPlanTrackerVar.ssn, directPlanTrackerVar.dob, directPlanTrackerVar.FName, directPlanTrackerVar.LName);
        if(updateAcc != null) {
            //Insert Direct pay Plan Change Tracker record along with old values of Account
            plnChngRes = createDirectPayTrackerRecord(directPlanTrackerVar, updateAcc, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                return plnChngRes;
            
            //Update Account only if it is Direct Pay
            //If a customer has enrolled for both Medicare and Direct Pay then that account will not be updated
            if(updateAcc.Medicare_Claim_Number_new__c == null){
                plnChngRes = updateDirectPayAccount(directPlanTrackerVar, updateAcc, plnChngRes);
                if(plnChngRes.result == 'ERROR')
                    return plnChngRes;
            }   
        } 
        
        //If Account not found
        else{
            //Insert Direct pay Plan Change Tracker record
            plnChngRes = createDirectPayTrackerRecord(directPlanTrackerVar, null, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                return plnChngRes;
            
            //Insert Account if not exists
            plnChngRes = insertDirectPayAccount(directPlanTrackerVar, plnChngRes);
            if(plnChngRes.result == 'ERROR')
                    return plnChngRes;
        }

        //Insert Opportunity 
        plnChngRes = insertDirectPayOpportunity(directPlanTrackerVar, plnChngRes);
        if(plnChngRes.result == 'ERROR')
            return plnChngRes;

        
        //Update Direct pay Plan Change Tracker record with Opportunity and Account
        plnChngRes = updatePlanChangeTrackerRecord(plnChngRes);
        if(plnChngRes.result == 'ERROR')
            return plnChngRes;
        
        
        return plnChngRes;
    }

    //Get Account record based on DOB, SSN, First Name and Last Name
    private static Account getMemberData(String SSN, String dob, String firstName, String LastName) {
        Account accdata = new Account();
        try {
            accdata = [Select Id, Marital_Status__c, Primary_Language__c,Phone, PersonBirthdate,
                       PersonMobilePhone, PersonEmail, Physical_Address_Line_1__c, Medicare_Claim_Number_new__c,
                       Physical_City__c, Physical_State__c, Physical_Zip_Code__c, Mailing_State__c, 
                       Mailing_Address_Same_As_Home_Address__c, Mailing_Address_Line_1__c, Mailing_City__c,
                       Mailing_Zip_Code__c, Primary_care_physician_name__c, Physician_Address__c, Physician_State__c,
                       Physician_City_town__c, Physician_Zip_code__c FROM Account WHERE LastName = : LastName
                       AND FirstName = : firstName AND PersonBirthdate = : date.parse(dob) LIMIT 1];
        } 
        catch (Exception e) {
            system.debug('Exception Occured' + e.getMessage());
            return null;
        }
            return accdata; 
    }


Raw Response
HTTP/1.1 404 Not Found Date: Fri, 14 Oct 2016 07:17:44 GMT Set-Cookie: BrowserId=yTCuswHmRoKXZvYgWh5Zgw;Path=/;Domain=.salesforce.com;Expires=Tue, 13-Dec-2016 07:17:44 GMT Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked
[ { "errorCode" : "NOT_FOUND", "message" : "The requested resource does not exist" } ]


 

Can any body help me can we deploye profiles from sandbox to production.....?

Hi i try to eliminate records that doesn't have children in this query :

 

[SELECT Id , (SELECT id FROM ActivityHistories) FROM Lead

 

By the way i tried to make inner join between leads and ActivityHistory but the system give me that you can't make inner join between these two objects.

 

-Thanks