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

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 1
    Likes Given
  • 9
    Questions
  • 9
    Replies
I'm using Merge API in batch apex with scope 1 (since Database.Merge() accepts one master record). I understand that the merge() call will only reparent the releated records but none of the values of the master record will be overridden with values of slave record. I've a requirement where if the fields on the master record are blank they should be overridden with the values of slave record. I can do the check and update the values of master record if the fields are handful, but we've approx. 700 fields on account. It's hard to check the emptiness for all the 700 fields and override with the values of the slave record. Is there any simple way to do this ? Any help on this is much appreciated. !

Thanks in advance..!!
I've detail page button (content source: Javascript), on Account detail page. Upon click of this button, data on Account will be sent to an inhouse application. Requirement is to show a progress bar upon the button click showing the progress of the data sent.

To summarize-

I'd like to know how can I show progress bar (animated image) with the statuses of integration completed.

For example:

Integration1 in progress..
Integration1 completed..

Integration2 in progress
Integration2 completed.

Any pointers on how to implement this is much appreciated..
Hi everyone !
I'm looking for some good design practice for the below scenario.
I've an object which has lot of fields and a record is being created/updated in one of the class (say mainClass). Query in the mainClass is going to exceed
20000 characters which is the max limit of SOQL query. We're going to add few more fields in the near future and definetely the query size exceeds the
max limit. I can create a query2 for the same object, but the issue is to leverage the doSOmething() in the Helper class, which has lot of business logic in it.
How can I leverage my doSomething() method in this situation.

Any pointers on this is much appreciated.

public class mainClass {

    public void sampleMethod1(){
      Object1 query1 = [SELECT field1__c,field2__c,field3__c,field4__c,......
                      .......
                      .......
                      FROM Object1 LIMIT1]; // This query is GOING TO exceed 20,000 characters which is the max limit for a SOQL query in Salesforce  

       query1.field1__c='test1';
       query1.field2__c='test2';
       Helper hlp = new Helper();
       hlp.doSometing(query1);
       update obj1;
      
    }
}


public class Helper{

    Object1 o1;
    public Helper(){
       o1 = new Object1();
    }
    
   public void doSomething(Object1 obj1){   
       o1=obj1;
       o1.field3__c = 'test3';
       o1.field4__c='test4';
       o1.field5__c='test5';
       .
       .
       .
       .
       .//lot of business logic exist here to map the Object1 fields
       .    
       .
       .       
   }
}

 

As part of an SOAP integration I'm doing. I've requirement where I need to pass the BinarySecurityToken in the header of the SOAP request. Unfortunately the WSDL will not contain the header information, so wsdl2apex convertor will not generate the associated Header classes.I've included the below snippet which is not working and erroring out as 'System.CalloutException: IO Exception: input contained no data'

I've added below two classes in the Webservice stub class that's generated-

    public class Security_element{ 
        public Security_element(String securityToken){
            this.securityToken = new BinarySecurityToken_element(securityToken);
            this.wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
        }
        
        public BinarySecurityToken_element securityToken;
        public String wsse;
        private String[] wsse_att_info = new String[] {'xmlns:wsse'};
        private String[] securityToken_type_info = new String[]  {'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};
    }
    
    public class BinarySecurityToken_element {
    
        public BinarySecurityToken_element(String securityToken) { 
             this.securityToken=securityToken;
             this.myValueType='wsse:X509v3';
             this.myEncodingType='wsse:Base64Binary'; 
             this.myID='X509Token';
        }
        public String securityToken;
        public String myValueType;
        public String myEncodingType;
        public String myID;
        
        private String[] securityToken_type_info = new String[]{'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};   
        private String[] myValueType_type_info=new String[]{'ValueType'};
        private String[] myEncodingType_type_info=new String[]{'EncodingType'};
        private String[] myID_type_info=new String[]{'Id'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};              
    }

******************This will go to class that makes the callout*************************

List docList = [select id, name,Body from document where name = 'secToken.txt']; //Docuement contains the security token I need to pass in the header
public wsSampleProjectV1.Security_element sec = new wsSampleProjectV2.Security_element(EncodingUtil.base64Encode(docList[0].body));
private String sec_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; 

*********SOAP Request Header that I need to pass is -

  <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:BinarySecurityToken ValueType="wsse:X509v3" EncodingType="wsse:Base64Binary" Id="X509Token">
                ---Encoded BinarySecurityToken goes here------
 
         </wsse:BinarySecurityToken>
      </wsse:Security>
      
   </soapenv:Header>

Any help on what's going wrong is much appreciated.
How to tag mandatory fields as minOccurs = "1" in the custom WSDL file that's generated from Apex class. Thanks in advance.
I've a requirement where I need to send some attachments tied to an account to an external inhouse application, with a button 'Send attachments'. To use the maximum size of SOAP request for an async call (12 MB) we want to make an asynch web service call using @future method. We've provided an inbound webservice for the external team to consume and update SFDC database with the status(success/failed) of the attachment upload, in the external database. How can I prompt the user once the external webservice updates the sfdc database letting him know the status of the document submission ? Any pointers on this that will have a better user experiencew are much appreciated.
Thanks in advance.
Is there a way to capture a SOAP request that's being sent to another application ? I want to capture and save it somewhere in SFDC to help the debugging process for failed transactions. Looking for some solution which can help us in debugging of a big request with a lot of fields.

Thanks in advance.

I have requirement where an external application will invoke a webservice operation ( which we give through a WSDL) and salesforce has to return a set of records of an object, based on some criteria ( like today's records) they enter in the WSDL. Please let me know if this is doable. Thanks in advance.
Governor limit question:
--------Maximum timeout for all callouts (HTTP requests or Web services calls) in a transaction 120 seconds------

Is my understanding correct ? If I've 3 callouts made, sum of all callout times should not exceed 120 seconds.
 
I've detail page button (content source: Javascript), on Account detail page. Upon click of this button, data on Account will be sent to an inhouse application. Requirement is to show a progress bar upon the button click showing the progress of the data sent.

To summarize-

I'd like to know how can I show progress bar (animated image) with the statuses of integration completed.

For example:

Integration1 in progress..
Integration1 completed..

Integration2 in progress
Integration2 completed.

Any pointers on how to implement this is much appreciated..

As part of an SOAP integration I'm doing. I've requirement where I need to pass the BinarySecurityToken in the header of the SOAP request. Unfortunately the WSDL will not contain the header information, so wsdl2apex convertor will not generate the associated Header classes.I've included the below snippet which is not working and erroring out as 'System.CalloutException: IO Exception: input contained no data'

I've added below two classes in the Webservice stub class that's generated-

    public class Security_element{ 
        public Security_element(String securityToken){
            this.securityToken = new BinarySecurityToken_element(securityToken);
            this.wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
        }
        
        public BinarySecurityToken_element securityToken;
        public String wsse;
        private String[] wsse_att_info = new String[] {'xmlns:wsse'};
        private String[] securityToken_type_info = new String[]  {'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};
    }
    
    public class BinarySecurityToken_element {
    
        public BinarySecurityToken_element(String securityToken) { 
             this.securityToken=securityToken;
             this.myValueType='wsse:X509v3';
             this.myEncodingType='wsse:Base64Binary'; 
             this.myID='X509Token';
        }
        public String securityToken;
        public String myValueType;
        public String myEncodingType;
        public String myID;
        
        private String[] securityToken_type_info = new String[]{'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};   
        private String[] myValueType_type_info=new String[]{'ValueType'};
        private String[] myEncodingType_type_info=new String[]{'EncodingType'};
        private String[] myID_type_info=new String[]{'Id'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};              
    }

******************This will go to class that makes the callout*************************

List docList = [select id, name,Body from document where name = 'secToken.txt']; //Docuement contains the security token I need to pass in the header
public wsSampleProjectV1.Security_element sec = new wsSampleProjectV2.Security_element(EncodingUtil.base64Encode(docList[0].body));
private String sec_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; 

*********SOAP Request Header that I need to pass is -

  <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:BinarySecurityToken ValueType="wsse:X509v3" EncodingType="wsse:Base64Binary" Id="X509Token">
                ---Encoded BinarySecurityToken goes here------
 
         </wsse:BinarySecurityToken>
      </wsse:Security>
      
   </soapenv:Header>

Any help on what's going wrong is much appreciated.
Governor limit question:
--------Maximum timeout for all callouts (HTTP requests or Web services calls) in a transaction 120 seconds------

Is my understanding correct ? If I've 3 callouts made, sum of all callout times should not exceed 120 seconds.
 
I've detail page button (content source: Javascript), on Account detail page. Upon click of this button, data on Account will be sent to an inhouse application. Requirement is to show a progress bar upon the button click showing the progress of the data sent.

To summarize-

I'd like to know how can I show progress bar (animated image) with the statuses of integration completed.

For example:

Integration1 in progress..
Integration1 completed..

Integration2 in progress
Integration2 completed.

Any pointers on how to implement this is much appreciated..
Hi everyone !
I'm looking for some good design practice for the below scenario.
I've an object which has lot of fields and a record is being created/updated in one of the class (say mainClass). Query in the mainClass is going to exceed
20000 characters which is the max limit of SOQL query. We're going to add few more fields in the near future and definetely the query size exceeds the
max limit. I can create a query2 for the same object, but the issue is to leverage the doSOmething() in the Helper class, which has lot of business logic in it.
How can I leverage my doSomething() method in this situation.

Any pointers on this is much appreciated.

public class mainClass {

    public void sampleMethod1(){
      Object1 query1 = [SELECT field1__c,field2__c,field3__c,field4__c,......
                      .......
                      .......
                      FROM Object1 LIMIT1]; // This query is GOING TO exceed 20,000 characters which is the max limit for a SOQL query in Salesforce  

       query1.field1__c='test1';
       query1.field2__c='test2';
       Helper hlp = new Helper();
       hlp.doSometing(query1);
       update obj1;
      
    }
}


public class Helper{

    Object1 o1;
    public Helper(){
       o1 = new Object1();
    }
    
   public void doSomething(Object1 obj1){   
       o1=obj1;
       o1.field3__c = 'test3';
       o1.field4__c='test4';
       o1.field5__c='test5';
       .
       .
       .
       .
       .//lot of business logic exist here to map the Object1 fields
       .    
       .
       .       
   }
}

 

As part of an SOAP integration I'm doing. I've requirement where I need to pass the BinarySecurityToken in the header of the SOAP request. Unfortunately the WSDL will not contain the header information, so wsdl2apex convertor will not generate the associated Header classes.I've included the below snippet which is not working and erroring out as 'System.CalloutException: IO Exception: input contained no data'

I've added below two classes in the Webservice stub class that's generated-

    public class Security_element{ 
        public Security_element(String securityToken){
            this.securityToken = new BinarySecurityToken_element(securityToken);
            this.wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
        }
        
        public BinarySecurityToken_element securityToken;
        public String wsse;
        private String[] wsse_att_info = new String[] {'xmlns:wsse'};
        private String[] securityToken_type_info = new String[]  {'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};
    }
    
    public class BinarySecurityToken_element {
    
        public BinarySecurityToken_element(String securityToken) { 
             this.securityToken=securityToken;
             this.myValueType='wsse:X509v3';
             this.myEncodingType='wsse:Base64Binary'; 
             this.myID='X509Token';
        }
        public String securityToken;
        public String myValueType;
        public String myEncodingType;
        public String myID;
        
        private String[] securityToken_type_info = new String[]{'wsse:BinarySecurityToken','http://www.w3.org/2001/XMLSchema','element','1','1','false'};   
        private String[] myValueType_type_info=new String[]{'ValueType'};
        private String[] myEncodingType_type_info=new String[]{'EncodingType'};
        private String[] myID_type_info=new String[]{'Id'};
        private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'securityToken'};              
    }

******************This will go to class that makes the callout*************************

List docList = [select id, name,Body from document where name = 'secToken.txt']; //Docuement contains the security token I need to pass in the header
public wsSampleProjectV1.Security_element sec = new wsSampleProjectV2.Security_element(EncodingUtil.base64Encode(docList[0].body));
private String sec_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; 

*********SOAP Request Header that I need to pass is -

  <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:BinarySecurityToken ValueType="wsse:X509v3" EncodingType="wsse:Base64Binary" Id="X509Token">
                ---Encoded BinarySecurityToken goes here------
 
         </wsse:BinarySecurityToken>
      </wsse:Security>
      
   </soapenv:Header>

Any help on what's going wrong is much appreciated.
How to tag mandatory fields as minOccurs = "1" in the custom WSDL file that's generated from Apex class. Thanks in advance.
Is there a way to capture a SOAP request that's being sent to another application ? I want to capture and save it somewhere in SFDC to help the debugging process for failed transactions. Looking for some solution which can help us in debugging of a big request with a lot of fields.

Thanks in advance.

I have requirement where an external application will invoke a webservice operation ( which we give through a WSDL) and salesforce has to return a set of records of an object, based on some criteria ( like today's records) they enter in the WSDL. Please let me know if this is doable. Thanks in advance.

I have a huge visualforce controller. The page it controls It has grown beyond what I ever imagined in terms of scope and features. Due to the massive amount of features and requirements I have hit the 100K character class limit. I think I can address this limit with class inheritance but please confirm I am doing this correctly.

 

"Parent" class. In this class I could store all variables, wrapper classes, and methods that are invoked from the constructor on initial page load

 

public virtual class Parent{

    public String input {get; set;}

    public Parent(){
        //Do initializations required on page load in this contructor, not child constructor.
        init();
    }
    
    public void init(){
        system.debug('Power up systems for launch!');
    }

    public void doSomethingParent(){
        system.debug('hi from parent');
    }
    
    public class wrapperClass{
        public String Name {get; set;}
    }
}

 

 

Child class that extends parent. Would contain mostly action methods called from page.

 

public class Child extends Parent{

    public void doSomethingChild(){
        system.debug('hi from child');
        doSomethingParent();
        WrapperClass test = new WrapperClass();
    }
}

 And the page which sets the controller as the "child" class. This way it can call methods in both classes.

 

<apex:page controller="Child" >
    <apex:form >
        <apex:commandButton value="Parent" action="{!doSomethingParent}"/>
        <apex:commandButton value="Child" action="{!doSomethingChild}"/>
    </apex:form>
</apex:page>

 

 

Does everything look good here. Am I following best practices?

 

Thanks,

Jason

 

Keyword: script too large

 

  • April 30, 2010
  • Like
  • 1