• satheeshrsk
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 27
    Replies
Hi All,

I have a Asynchronous outbound call, which is called from a trigger.  I am struck to write a test class for my outbound call ( synchronous ), can any one please help me how to write a test class for my outbound call.  Any help must be highly appreciated.

Thanks a lot in advance!

Regards,
rsk

Hi All,

 

Is there any way to test blank values for Integer fileds, for Strings fields

if( Str == '') or Isblank(Str) ...

Any help must be highly appreciated.

Thanks in advance !



Hi All,

 

Is it possible to generate a Enterprise WSDL with Only Login method. Any help is highly appreciated.

 

Thanks in advance!

 

RSK

Hi All,

 

I need to Integrate Twitter with Salesforce and get the tweets / posts into salesfoce chatter. Can anyone please give some idea / sample code ? Any help is highly appreciated.

 

 

Thanks a ton inadvance.

Hi All,

 

Getting the following error,can any one help if any idea ?

 

ErrorError: Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Date, String) at line 15 column 29

 

 

Controller class:

public with sharing class CustomSettingsDemo_CLS{
  public String selectedIso {get;set;}
 

   public CustomSettingsDemo_CLS(ApexPages.StandardController controller) {

    }
    
    public List<selectOption> fqCodes {
        get {
             List<selectOption> options = new List<selectOption>();
 
            for (FiscalQuarters__c fq : FiscalQuarters__c.getAll().values())
                options.add(new SelectOption(fq.CustomFiscalQuarters__c,fq.Name+' - '+fq.CustomFiscalQuarters__c));
            return options;
 
        }
        set;
    }
 
}

 

Using custom setting in the controller class, any help is highly appreciated.

 

 

Thanks in advance,

rsk

 

 

 

Hi,

 

I am trying to add a custom button to the Product related list on my Opportunity page. It does not shows any custom buttons section on Product related list. The button type is List Button and the VF page uses  standard controller and extension controller class. Any  help must be highly appreciated.

 

 

Thanks in advance !

 

Hi,

I am trying to make a callout from APEX to an HTTP endpoint(Hoover's API)  but am receiving the following error:

 
 500, internal server error'.

Here is my Apex class :



global public with sharing class HttpCallout_CLS {

    Public static void sendRequest(){
   
    String API_KEY = 'XXX';
   
    String env;
    env =  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://applications.dnb.com/webservice/schema/">'+
             '<soapenv:Header>'+
                '<sch:API-KEY>XXX</sch:API-KEY>'+
             '</soapenv:Header>'+
             '<soapenv:Body>'+
               '<sch:FindCompanyByKeywordRequest>'+
                 '<sch:sortDirection>Ascending</sch:sortDirection>'+

                 '<sch:keyword>xyz</sch:keyword>'+

- Hide quoted text -

                 '<sch:searchBy>companyName</sch:searchBy>'+
                 '<sch:returnSearchNavigation>false</sch:returnSearchNavigation>'+
                 '<sch:orderBy xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>'+
                 '<sch:searchNavigation>'+
                   '<sch:employeeSearchNavigation>'+
                   '</sch:employeeSearchNavigation>'+
                   '<sch:ownershipTypeSearchNavigation>'+
                   '</sch:ownershipTypeSearchNavigation>'+
                   '<sch:locationTypeSearchNavigation>'+
                   '</sch:locationTypeSearchNavigation>'+
                   '<sch:salesSearchNavigation>'+
                   '</sch:salesSearchNavigation>'+
                   '<sch:locationSearchNavigation>'+
                     '<sch:countryNavigation>'+
                       '<sch:countryNavigationValue>${#Project#countryNavigationValue}</sch:countryNavigationValue>'+
                       '<sch:stateNavigation>'+
                        '<sch:stateNavigationValue>${#Project#stateNavigationValue}</sch:stateNavigationValue>'+
                        '<sch:cityNavigation>'+
                          '<sch:cityNavigationValue>${#Project#cityNavigationValue}</sch:cityNavigationValue>'+
                        '</sch:cityNavigation>'+
                      '</sch:stateNavigation>'+
                    '</sch:countryNavigation>'+
                  '</sch:locationSearchNavigation>'+
                  '<sch:industrySearchNavigation>'+
                  '</sch:industrySearchNavigation>'+
                '</sch:searchNavigation>'+
              '</sch:FindCompanyByKeywordRequest>'+
            '</soapenv:Body>'+
          '</soapenv:Envelope>';
 
   Http h = new Http();
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://hapi.hoovers.com/HooversAPI-32');
    req.setMethod('POST');
    req.setBody(env);
    req.setTimeout(12000);
   

    Blob headerValue = Blob.valueOf(API_KEY);


    String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

    req.setHeader('Authorization',authorizationHeader)

;

       
    HTTPResponse res = h.send(req);
    System.debug(res.getBody());
    }
}




  I tried with username and password also, even though i'm facing the same issue. Has anyone experienced anything similar to this?.   Any help must be appreciated.
Thanks Inadvance,
Satheesh

Hi,

I am trying to make a callout from APEX to an HTTP endpoint(Hoover's API)  but am receiving the following error:

 
 500, internal server error'.

Here is my Apex class :



global public with sharing class HttpCallout_CLS {

    Public static void sendRequest(){
   
    String API_KEY = 'XXX';
   
    String env;
    env =  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://applications.dnb.com/webservice/schema/">'+
             '<soapenv:Header>'+
                '<sch:API-KEY>XXX</sch:API-KEY>'+
             '</soapenv:Header>'+
             '<soapenv:Body>'+
               '<sch:FindCompanyByKeywordRequest>'+
                 '<sch:sortDirection>Ascending</sch:sortDirection>'+

                 '<sch:keyword>xyz</sch:keyword>'+

- Hide quoted text -

                 '<sch:searchBy>companyName</sch:searchBy>'+
                 '<sch:returnSearchNavigation>false</sch:returnSearchNavigation>'+
                 '<sch:orderBy xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>'+
                 '<sch:searchNavigation>'+
                   '<sch:employeeSearchNavigation>'+
                   '</sch:employeeSearchNavigation>'+
                   '<sch:ownershipTypeSearchNavigation>'+
                   '</sch:ownershipTypeSearchNavigation>'+
                   '<sch:locationTypeSearchNavigation>'+
                   '</sch:locationTypeSearchNavigation>'+
                   '<sch:salesSearchNavigation>'+
                   '</sch:salesSearchNavigation>'+
                   '<sch:locationSearchNavigation>'+
                     '<sch:countryNavigation>'+
                       '<sch:countryNavigationValue>${#Project#countryNavigationValue}</sch:countryNavigationValue>'+
                       '<sch:stateNavigation>'+
                        '<sch:stateNavigationValue>${#Project#stateNavigationValue}</sch:stateNavigationValue>'+
                        '<sch:cityNavigation>'+
                          '<sch:cityNavigationValue>${#Project#cityNavigationValue}</sch:cityNavigationValue>'+
                        '</sch:cityNavigation>'+
                      '</sch:stateNavigation>'+
                    '</sch:countryNavigation>'+
                  '</sch:locationSearchNavigation>'+
                  '<sch:industrySearchNavigation>'+
                  '</sch:industrySearchNavigation>'+
                '</sch:searchNavigation>'+
              '</sch:FindCompanyByKeywordRequest>'+
            '</soapenv:Body>'+
          '</soapenv:Envelope>';
 
   Http h = new Http();
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://hapi.hoovers.com/HooversAPI-32');
    req.setMethod('POST');
    req.setBody(env);
    req.setTimeout(12000);
   
    Blob headerValue = Blob.valueOf(API_KEY);

    String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
    req.setHeader('Authorization',authorizationHeader);

       
    HTTPResponse res = h.send(req);
    System.debug(res.getBody());
    }
}




  I tried with username and password also, even though i'm facing the same issue. Has anyone experienced anything similar to this?.   Any help must be appreciated.

Thanks Inadvance,
Satheesh

Hi,

I am trying to make a callout from APEX to an HTTP endpoint(Hoover's API)  but am receiving the following error:

 
 500, internal server error'.

Here is my Apex class :



global public with sharing class HttpCallout_CLS {

    Public static void sendRequest(){
   
    String API_KEY = 'XXX';
   
    String env;
    env =  '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://applications.dnb.com/webservice/schema/">'+
             '<soapenv:Header>'+
                '<sch:API-KEY>XXX</sch:API-KEY>'+
             '</soapenv:Header>'+
             '<soapenv:Body>'+
               '<sch:FindCompanyByKeywordRequest>'+
                 '<sch:sortDirection>Ascending</sch:sortDirection>'+

                 '<sch:keyword>xyz</sch:keyword>'+

- Hide quoted text -

                 '<sch:searchBy>companyName</sch:searchBy>'+
                 '<sch:returnSearchNavigation>false</sch:returnSearchNavigation>'+
                 '<sch:orderBy xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>'+
                 '<sch:searchNavigation>'+
                   '<sch:employeeSearchNavigation>'+
                   '</sch:employeeSearchNavigation>'+
                   '<sch:ownershipTypeSearchNavigation>'+
                   '</sch:ownershipTypeSearchNavigation>'+
                   '<sch:locationTypeSearchNavigation>'+
                   '</sch:locationTypeSearchNavigation>'+
                   '<sch:salesSearchNavigation>'+
                   '</sch:salesSearchNavigation>'+
                   '<sch:locationSearchNavigation>'+
                     '<sch:countryNavigation>'+
                       '<sch:countryNavigationValue>${#Project#countryNavigationValue}</sch:countryNavigationValue>'+
                       '<sch:stateNavigation>'+
                        '<sch:stateNavigationValue>${#Project#stateNavigationValue}</sch:stateNavigationValue>'+
                        '<sch:cityNavigation>'+
                          '<sch:cityNavigationValue>${#Project#cityNavigationValue}</sch:cityNavigationValue>'+
                        '</sch:cityNavigation>'+
                      '</sch:stateNavigation>'+
                    '</sch:countryNavigation>'+
                  '</sch:locationSearchNavigation>'+
                  '<sch:industrySearchNavigation>'+
                  '</sch:industrySearchNavigation>'+
                '</sch:searchNavigation>'+
              '</sch:FindCompanyByKeywordRequest>'+
            '</soapenv:Body>'+
          '</soapenv:Envelope>';
 
   Http h = new Http();
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://hapi.hoovers.com/HooversAPI-32');
    req.setMethod('POST');
    req.setBody(env);
    req.setTimeout(12000);
   
    Blob headerValue = Blob.valueOf(API_KEY);

    String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
    req.setHeader('Authorization',authorizationHeader);

       
    HTTPResponse res = h.send(req);
    System.debug(res.getBody());
    }
}




  I tried with username and password also, even though i'm facing the same issue. Has anyone experienced anything similar to this?.   Any help must be appreciated.

Thanks Inadvance,
Satheesh

Hi,

 

  This is kumar, I’m new to salesforce. I need to call an external application from Apex through HTTP Call outs. Could any one send me the sample code, how to parse and call (invoke) external application(wsdl). Any help must be appreciated .

 

 

Thanks inadvance!

Kumar

Every time a case owner is changed (from Queue to Engineer, and vice versa), the automatic sharing rules are deleted, how to write a trigger to automatically reshare, after an ownership change.

 

Thanks!

 

Hello,
    I'm facing a issue with mobile application, I added Case Object to the Dataset and case comments as subset of Case to the mobile configuration. My profile is system admin, the problem is i'm able to see the case comments, but some of other people with different profile and role are not able to see case comments. I tried by changing their profile as admin and as same role i have, but even they are not able to see the case comments.
I tried by changing my profile and role to other user profile, still am able to see the comments for all the cases.

Please let me know what would be issue, this is very high priority. Please throw a light.

 

Regards,
Satheesh

Hi All,

 

Is there any way to test blank values for Integer fileds, for Strings fields

if( Str == '') or Isblank(Str) ...

Any help must be highly appreciated.

Thanks in advance !



Hi All,

 

I need to Integrate Twitter with Salesforce and get the tweets / posts into salesfoce chatter. Can anyone please give some idea / sample code ? Any help is highly appreciated.

 

 

Thanks a ton inadvance.

Hi All,

I have replaced Activity History related list with a VF page using Standard Controller, the issue is data is not displaying order by, I want to sort the activity histories based on lastModified date/time, how to do that ? any help is highly appreciated.

 

Here is the VF:

 

<apex:page standardController="Case" extensions="ActivityHistory_cls">
 <apex:form >
     <apex:pageBlock title="Activity History" >
        
        <apex:pageBlockTable value="{!Case.ActivityHistories}" var="list" id="theId">
           
            <apex:column headerValue="Subject"><apex:outputField value="{!list.Subject}"/> </apex:column>
            <apex:column headerValue="Name"><apex:outputField value="{!list.WhoId}"/> </apex:column>
            <apex:column headerValue="Task"> <apex:outputField value="{!list.IsTask}"/> </apex:column>
            <apex:column headerValue="Due Date"> <apex:outputField value="{!list.ActivityDate}"/> </apex:column>
            <apex:column headerValue="LastModified Date/Time">  <apex:outputField value="{!list.LastModifiedDate}"/></apex:column>
       </apex:pageblockTable>    
     </apex:pageBlock>
 </apex:form>
</apex:page>

 

Thanks in advance,

SK

Hi All,

 

Getting the following error,can any one help if any idea ?

 

ErrorError: Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Date, String) at line 15 column 29

 

 

Controller class:

public with sharing class CustomSettingsDemo_CLS{
  public String selectedIso {get;set;}
 

   public CustomSettingsDemo_CLS(ApexPages.StandardController controller) {

    }
    
    public List<selectOption> fqCodes {
        get {
             List<selectOption> options = new List<selectOption>();
 
            for (FiscalQuarters__c fq : FiscalQuarters__c.getAll().values())
                options.add(new SelectOption(fq.CustomFiscalQuarters__c,fq.Name+' - '+fq.CustomFiscalQuarters__c));
            return options;
 
        }
        set;
    }
 
}

 

Using custom setting in the controller class, any help is highly appreciated.

 

 

Thanks in advance,

rsk

 

 

 

Hi All,

 

Following is the error displayed when i use formula field in trigger:

Error: Compile Error: Field is not writeable: Potential__c.Contact_Status__c at line 5 column 4

 

trigger updatefield on Potential__c (after insert,after update)
{
for (Potential__c ptl:trigger.new)
{
if(ptl.Contact_Status__c='TRUE')
if(ptl.Opportunity_Stage__C!='CLOSED WON')

ptl.Opportunity_Stage__C='CLOSED WON';
}
}

 

Kindly advice as to what can be the error.

Many thanks in advance.

  • September 08, 2012
  • Like
  • 0

Hi,

 

I am trying to add a custom button to the Product related list on my Opportunity page. It does not shows any custom buttons section on Product related list. The button type is List Button and the VF page uses  standard controller and extension controller class. Any  help must be highly appreciated.

 

 

Thanks in advance !

 

Hi,

 

Requirement is to get Tweets of my contact/Person account and store it in to salesforce.

Can this be achieved by authentication Twitter API using oauth 1.0
 and How.

 

It's Urgent and i would like the input from you people.Step to step guide if possible

 

Thanks,
Subham

  • August 05, 2012
  • Like
  • 0

Hi,

 

Requirement is to get Tweets of my contact/Person account and store it in to salesforce.

Can this be achieved by authentication Twitter API using oauth 1.0
 and How.

 

It's Urgent and i would like the input from you people.Step to step guide if possible

 

Thanks,
Subham

 

 

  • August 05, 2012
  • Like
  • 0

Hi All,

 

I am trying to connect salesforce to twitter, but when I make callout it throws exception to me:

<error code="53">Basic authentication is not supported</error>

 

I checked that twitter has turned on the basic authentication, but I am not sure how to call twitter from salesforce now.

 

My existing code is:

Http h = new Http();
		HttpRequest req = new HttpRequest();
		req.setMethod('POST');
		req.setEndpoint('https://api.twitter.com/1/statuses/update.xml');
		req.setHeader('Content-Type','application/x-www-form-urlencoded');
		Blob headerValue = Blob.valueOf('username:password');
      	String authorizationHeader = 'OAuth ' + EncodingUtil.base64Encode(headerValue);
      	req.setHeader('Authorization', authorizationHeader);
      	
		req.setBody('status=Test Data');
		HttpResponse res = h.send(req);
		system.debug('&&&&&&&&&&&&&&&&7' + res.getBody());

 

Regards,

R

 

I am trying to add a date field that would enable my sales team to simply select the fiscal quarter for their Opportunity forecast.  I not particularly concerned about the close date or required delivery date.  

 

Is there any way to create a picklist field that would enable us to select the quarter-year  (eg, Q4 2010) that would correspond to my company-specific fiscal calendar which I have already entered into Salesforce?

 

Thanks in advance for any thoughts you have to offer!

I am trying to add a custom button to the Product related list on my Opportunity page.  I have created the button but it does not appear as an option in the page layout.  The button is a List type and calls a VF page.  The VF page does not use a standard controller.

 

I successfully created a similar custom button on the Campaign History related list on my Contact page layout.  How is this any different?

 

Any ideas?

 

Thanks,

Barb