• Aljebouri
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
i wrote a test class to test a trigger and future apex class, nevertheless i am reciving this error message, can anyone help me out

System.DmlException: Update failed. First exception on row 0 with id 00Q260000034xE0EAI; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CP_Approve_Rejects: execution of AfterUpdate

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.CP_Approve_Rejects: line 9, column 1: []


Test class code as below
@isTest
private class CP_Approve_Reject_Test {
    static testmethod void  Approve_CP_Lead() {              
        // This causes a fake response to be generated
         Lead lead = new Lead(firstName='first', lastName='last', company='company', leadSource='Client-Portal-Lead-Cn', entity__c='Hong Kong', isTest__c=true);
      
        
              
              
        Test.startTest();
         insert lead;
          Lead leads = lead;
         leads.Approval_Status__c ='Approved';
         update(leads);
        Test.setMock(WebServiceMock.class, new ADSSWebServicesMockImpl());
         
        // Test.setMock(WebServiceMock.class, new ADSSWebServicesMockImpl());
        
        Test.stopTest();

    }
    
    }
Dear All,

I want to have three objects linked in a realtionship as below

1. I have Object A, B and C
2. I want to build 1 - 1 realtion between A and B
3. i want to build many to many realtion betweeb B and C
4. in object A Layout i want to have related list contains data from Object C

can you help on how i can achieve above?

Regards,
​Ahmad
Hi All,

We have developed a web service to be called from SalesFroce, it returns different Data Type, how i can handle multiple data type retruned fom the web service, below webserivce imported into SF

to rephrase my question when i write a class to call the webservice what shall be the defined return type please see below example of a web service return a string

IBPortalWS_LinkMT4Account.Link_MT4AccountPort stub= new  IBPortalWS_LinkMT4Account.Link_MT4AccountPort();
String output = stub.Link_Account(String.valueof(ac.IBPortalID__c),ld.Name,ids);


so in th emulti return type web service what i shall replace the String output with? shall i replace it with ComAdssClientPortalSF.ApprovalResponse_element if so, how i can determine what was exactly returned?

//Generated by wsdl2apex

public class ComAdssClientPortalSF {
    public class ApprovalResponse_element {
        public Boolean success;
        public String errorCode;
        private String[] success_type_info = new String[]{'success','http://com/adss/clientportal/sfapi',null,'1','1','false'};
        private String[] errorCode_type_info = new String[]{'errorCode','http://com/adss/clientportal/sfapi',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://com/adss/clientportal/sfapi','true','false'};
        private String[] field_order_type_info = new String[]{'success','errorCode'};
    }
    public class ApprovalRequest_element {
        public String emailAddress;
        private String[] emailAddress_type_info = new String[]{'emailAddress','http://com/adss/clientportal/sfapi',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://com/adss/clientportal/sfapi','true','false'};
        private String[] field_order_type_info = new String[]{'emailAddress'};
    }
    public class ClientServiceSoap11 {
        public String endpoint_x = 'http://192.168.6.65:8080/client-portal-web/endpoints';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://com/adss/clientportal/sfapi', 'ComAdssClientPortalSF'};
        public ComAdssClientPortalSF.ApprovalResponse_element Approval(String emailAddress) {
            ComAdssClientPortalSF.ApprovalRequest_element request_x = new ComAdssClientPortalSF.ApprovalRequest_element();
            request_x.emailAddress = emailAddress;
            ComAdssClientPortalSF.ApprovalResponse_element response_x;
            Map<String, ComAdssClientPortalSF.ApprovalResponse_element> response_map_x = new Map<String, ComAdssClientPortalSF.ApprovalResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://com/adss/clientportal/sfapi',
              'ApprovalRequest',
              'http://com/adss/clientportal/sfapi',
              'ApprovalResponse',
              'ComAdssClientPortalSF.ApprovalResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }
    }
}

I would like to create an workflow apprvoal for lead convertion into account i want to achieve the below.

1. Sales want to convert lead to account, they submit the case to another department approval
2. The concerned department receive approval request
3. If concern deparmtnet approved the reuqest the lead need to be converted automatically into an account.
4. if concerened department reject then sales will receive a notification of the rejection adn lead will not be converted.

I would like your help on how i can achieve the above in sales force specially once approved how to automatically convert the lead?”

 

Regards,

Ahmad

i wrote a test class to test a trigger and future apex class, nevertheless i am reciving this error message, can anyone help me out

System.DmlException: Update failed. First exception on row 0 with id 00Q260000034xE0EAI; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CP_Approve_Rejects: execution of AfterUpdate

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.CP_Approve_Rejects: line 9, column 1: []


Test class code as below
@isTest
private class CP_Approve_Reject_Test {
    static testmethod void  Approve_CP_Lead() {              
        // This causes a fake response to be generated
         Lead lead = new Lead(firstName='first', lastName='last', company='company', leadSource='Client-Portal-Lead-Cn', entity__c='Hong Kong', isTest__c=true);
      
        
              
              
        Test.startTest();
         insert lead;
          Lead leads = lead;
         leads.Approval_Status__c ='Approved';
         update(leads);
        Test.setMock(WebServiceMock.class, new ADSSWebServicesMockImpl());
         
        // Test.setMock(WebServiceMock.class, new ADSSWebServicesMockImpl());
        
        Test.stopTest();

    }
    
    }
Dear All,

I want to have three objects linked in a realtionship as below

1. I have Object A, B and C
2. I want to build 1 - 1 realtion between A and B
3. i want to build many to many realtion betweeb B and C
4. in object A Layout i want to have related list contains data from Object C

can you help on how i can achieve above?

Regards,
​Ahmad