• SKumar SFDC
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Dear Folks,

I'm struggling to figure out the error and need your help. I'm trying to workout SOAP Integration between 2 salesforce org, encounteres below error. Pls help me out. 

Error: Invalid Data. Review all error messages below to correct your data. Apex trigger AccountSyncSOAP caused an unexpected exception, contact your administrator: AccountSyncSOAP: execution of AfterInsert caused by: System.CalloutException: Callout from triggers are currently not supported.: Class.partnerSoapSforceCom.Soap.login: line 3410, column 1

APEX class:
public class AccountSyncSOAP {

    public static void Connector(String name){
        partnerSoapSforceCom.soap myPartnerSOAP = new partnerSoapSforceCom.soap();
        partnerSoapSforceCom.LoginResult partnerLoginResult = myPartnerSOAP.login('username@username.com','PASSWORD+TOKENHgaWESnkrmTdX8ouH0BPJGmhE');
        
        system.debug('partnerLoginResult >>>>>'+partnerLoginResult);
        system.debug('partnerLoginResult >>>>>'+partnerLoginResult.sessionId);
        
        soapAccount.SessionHeader_element webserviceSessionHeader = new soapAccount.SessionHeader_element();
        webserviceSessionHeader.sessionId = partnerLoginResult.sessionId;
        
        soapAccount.AccountSyncSOAP objA1 = new soapAccount.AccountSyncSOAP();
        objA1.SessionHeader = webserviceSessionHeader;
        String Id = objA1.createAccount(name);
        system.debug('ID >>>>>> '+Id);
    }
}

WSDL(Partner):
//Generated by wsdl2apex

public class soapAccount {
    public class LogInfo {
        public String category;
        public String level;
        private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'category','level'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class address {
        public String city;
        public String country;
        public String countryCode;
        public String geocodeAccuracy;
        public String postalCode;
        public String state;
        public String stateCode;
        public String street;
        private String[] city_type_info = new String[]{'city','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] country_type_info = new String[]{'country','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] countryCode_type_info = new String[]{'countryCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] geocodeAccuracy_type_info = new String[]{'geocodeAccuracy','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] postalCode_type_info = new String[]{'postalCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] state_type_info = new String[]{'state','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] stateCode_type_info = new String[]{'stateCode','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] street_type_info = new String[]{'street','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'city','country','countryCode','geocodeAccuracy','postalCode','state','stateCode','street'};
    }
    public class SessionHeader_element {
        public String sessionId;
        private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'sessionId'};
    }
    public class CallOptions_element {
        public String client;
        private String[] client_type_info = new String[]{'client','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'client'};
    }
    public class DebuggingHeader_element {
        public soapAccount.LogInfo[] categories;
        public String debugLevel;
        private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'0','-1','false'};
        private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'categories','debugLevel'};
    }
    public class location {
        public Double latitude;
        public Double longitude;
        private String[] latitude_type_info = new String[]{'latitude','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] longitude_type_info = new String[]{'longitude','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'latitude','longitude'};
    }
    public class AllowFieldTruncationHeader_element {
        public Boolean allowFieldTruncation;
        private String[] allowFieldTruncation_type_info = new String[]{'allowFieldTruncation','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'allowFieldTruncation'};
    }
    public class createAccount_element {
        public String Name;
        private String[] Name_type_info = new String[]{'Name','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'Name'};
    }
    public class createAccountResponse_element {
        public String result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/schemas/class/AccountSyncSOAP',null,'1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public class AccountSyncSOAP {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/AccountSyncSOAP';
        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;
        public soapAccount.SessionHeader_element SessionHeader;
        public soapAccount.DebuggingInfo_element DebuggingInfo;
        public soapAccount.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        public soapAccount.CallOptions_element CallOptions;
        public soapAccount.DebuggingHeader_element DebuggingHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/AccountSyncSOAP';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountSyncSOAP', 'soapAccount'};
        public String createAccount(String Name) {
            soapAccount.createAccount_element request_x = new soapAccount.createAccount_element();
            request_x.Name = Name;
            soapAccount.createAccountResponse_element response_x;
            Map<String, soapAccount.createAccountResponse_element> response_map_x = new Map<String, soapAccount.createAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/AccountSyncSOAP',
              'createAccount',
              'http://soap.sforce.com/schemas/class/AccountSyncSOAP',
              'createAccountResponse',
              'soapAccount.createAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }
}
Dear Experts,

I'm new bee to APEX (and programing), can you pls explain me to understand below code (bold Highlighted):
- encriptedFieldsMap.put, What Map gets if inner class constructor calls?

Request: I'm new to programming, kindly articulate your answer in a lay man language.. thanks in advance.

Thanks,
Srujan

public class EncriptFieldValueMover {
   
    public Map<String,EncriptFieldValueMover.EncriptedField> encriptedFieldsMap {get;private set;}
    public String fieldApiName = 'FieldAPI';
    public Account encFieldCS;
   
    public EncriptFieldValueMover(){
        encriptedFieldsMap = new Map<String,EncriptFieldValueMover.EncriptedField>();
        encriptedFieldsMap.put(fieldApiName,new EncriptFieldValueMover.EncriptedField(fieldApiName,encFieldCS));
    }
 
    public class EncriptedField{
        private String fieldAPIName;
        private String elatedEncriptedField;
        public account encFieldCS {get; private set;}
       
        public EncriptedField(String fieldAPIName, Account encFieldCS){
            this.fieldAPIName = fieldAPIName;
            this.encFieldCS = encFieldCS;
        }
       
        public String getFieldAPIName(){
            return fieldAPIName;
        }
       
        public String getRelatedEncriptedField(){
            return encFieldCS.Name;
        }
    }
}
Dear Folks, 

Here I have 2 classes created - Input_Class & Leads.
Input_Class - Returns lead values, where as Leads - Inserts records.

Issue:
The Issue is How should I get Input_Class return values into Lead class? here is the code which I try to write..

Input_Class======================>>>>>>>>>>>>>>>>
public static with sharing class Input_Class {    
    public static list<lead> lead_input(){
        list<lead> ld = new list<lead>();
        ld.add(new lead(LastName='Kannamma',Company='Kanni tech',Status='Open - Not Connected'));
      return ld;
    }
}

Leads Class =================================>>>>>>>>>
public static with sharing class Leads {    
    public static void Lead_create(){
        Input_Class.lead_input(); // How could I get above inputclass ld values here?????????????????
        update ld;            
    }
}
Hello,

I'm newbee for SFDC and please clarify my below doubt.

While creating custome VF page, we create custom Controllers as class, Fields as variables and the logic which ever written in that class controlls Controller behaviour of the page.. This is what I know for custom page creation using VF

But my question is.....

1. Assume I created a custom object and created 2 fields using customization, How can I create a custom controller for this page? How can I write a behaviour of those 2 fields?

2. I don't see Developer mode coumn (at the bottom of the page) for a page which is achieved through customization but I can only see for custome VF Page.

Please clarify and thanks in advance.
 
Hello,

I'm newbee for SFDC and please clarify my below doubt.

While creating custome VF page, we create custom Controllers as class, Fields as variables and the logic which ever written in that class controlls Controller behaviour of the page.. This is what I know for custom page creation using VF

But my question is.....

1. Assume I created a custom object and created 2 fields using customization, How can I create a custom controller for this page? How can I write a behaviour of those 2 fields?

2. I don't see Developer mode coumn (at the bottom of the page) for a page which is achieved through customization but I can only see for custome VF Page.

Please clarify and thanks in advance.