• e r i c.ax249
  • NEWBIE
  • 65 Points
  • Member since 2006

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 25
    Replies

Hi,

 

I have recently change my PC and reinstalled the development tools. I did it with Eclipse 3.4, the salesforce plugin and I found that Apexcode and visualforce code are colored, but javascript code (embeded in VF code) is not.

 

Does anybody know how to enable that in my Eclipse?

 

Regards,

 

Wilmer 

Hello all.  We have a trigger on the Task object that looks at the WhatId and/or WhoId to update certain fields on the related Account.  A user reported an issue to us when adding emails to Account and Contact records.  Upon taking a look at the debug logs, the WhatId and WhoId are both NULL in Before and After triggers.  However, after the Task record is saved, the WhatId and WhoId are properly set.  The logic of the trigger does not execute properly since the values are NULL when the trigger is executing.  Even if I perform a query in the After trigger for the WhatId and WhoId, they are still NULL.

 

How does Salesforce for Outlook work regarding the WhatId and WhoId?

 

System.debug commands:

	for (Task record : Trigger.new) {
		System.debug(record.WhoId);
		System.debug(record.WhatId);
		System.debug(record.Status);
		System.debug([SELECT Id, WhoId FROM Task WHERE Id = :record.Id].WhoId);

 Result in debug log:

15:26:09.682 (682782000)|USER_DEBUG|[13]|DEBUG|null
15:26:09.682 (682788000)|SYSTEM_METHOD_EXIT|[13]|System.debug(ANY)
15:26:09.682 (682839000)|SYSTEM_METHOD_ENTRY|[14]|System.debug(ANY)
15:26:09.682 (682850000)|USER_DEBUG|[14]|DEBUG|null
15:26:09.682 (682856000)|SYSTEM_METHOD_EXIT|[14]|System.debug(ANY)
15:26:09.682 (682940000)|SYSTEM_METHOD_ENTRY|[15]|System.debug(ANY)
15:26:09.682 (682953000)|USER_DEBUG|[15]|DEBUG|Completed
15:26:09.682 (682959000)|SYSTEM_METHOD_EXIT|[15]|System.debug(ANY)
15:26:09.683 (683169000)|SOQL_EXECUTE_BEGIN|[16]|Aggregations:0|select Id, WhoId from Task where Id = :tmpVar1
15:26:09.700 (700279000)|SOQL_EXECUTE_END|[16]|Rows:1
15:26:09.700 (700390000)|SYSTEM_METHOD_ENTRY|[16]|System.debug(ANY)
15:26:09.700 (700398000)|USER_DEBUG|[16]|DEBUG|null

 

 

I could be missing something here, but Salesforce Touch has always been, and is still, advertised to work with "any device", "anywhere".  I understand a phased rollout and what not, so it makes sense that it is only available for iPad 2 and 3 in the initial release.  But, there is no mention of when it will be available for any other device.  I'm specifically interested in Android 4.0 on an Acer tablet, but I can't find "any" information "anywhere" about it.  I just go to the site every so often (it's been a long time now) and all I've ever seen is "coming soon".  But then I came to know that it's already available for iPad 2 and 3 running 5.0 or higher.

The "Record Type Selection" option is under "Personal Setup"->"My Personal Information".  It basically allows the default Record Type to be selected automatically when creating a new record.  Is there any way I can update this preference programmatically, either through the web services API or Apex?  We basically want to give users access to a new record type, but do not want them to be prompted for record type selection when creating a new record.  We would like to set this option automatically without having the users set it themselves.

I created an Apex class using the "Generate From WSDL" functionality.  One of the methods that is called returns a list of customers from a backend system.  The problem is that certain searches return more than 1000 customers and I receive the "Collection size x,xxx exceeds maximum size of 1,000" error.  How can I limit the number of elements added to the object array that is populated by the response?

Here is the proxy class generated:

//Generated by wsdl2apex

public class companyCsrService {
    public class CommentaryDataRequest {
        public String contractNumber;
        public String sourceSystem;
        private String[] contractNumber_type_info = new String[]{'contractNumber','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'contractNumber','sourceSystem'};
    }
    public class AccountResult {
        public companyCsrService.ErrorList errorList;
        public companyCsrService.AccountInfo[] accountInfo;
        private String[] errorList_type_info = new String[]{'errorList','http://www.company.com/CreditSurveillance','ErrorList','0','1','false'};
        private String[] accountInfo_type_info = new String[]{'accountInfo','http://www.company.com/CreditSurveillance','AccountInfo','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'errorList','accountInfo'};
    }
    public class AccountInfo {
        public Integer customerID{  get; set;  }
        public String customerName{  get; set;  }
        public String pdGrade{  get; set;  }
        public String lgdGrade{  get; set;  }
        public String billingState{  get; set;  }
        public String billingCountry{  get; set;  }
        public String businessSegment{  get; set;  }
        public String businessUnitCode{  get; set;  }
        public String industry{  get; set;  }
        public String sicCode{  get; set;  }
        public String contractID{  get; set;  }
        public String sourceSystem{  get; set;  }
        public String csrUniqueKey{  get; set;  }
        public String plmStatus {  get; set;  }
        private String[] customerID_type_info = new String[]{'customerID','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] customerName_type_info = new String[]{'customerName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] pdGrade_type_info = new String[]{'pdGrade','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lgdGrade_type_info = new String[]{'lgdGrade','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] billingState_type_info = new String[]{'billingState','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] billingCountry_type_info = new String[]{'billingCountry','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessSegment_type_info = new String[]{'businessSegment','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessUnitCode_type_info = new String[]{'businessUnitCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] industry_type_info = new String[]{'industry','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sicCode_type_info = new String[]{'sicCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] contractID_type_info = new String[]{'contractID','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] csrUniqueKey_type_info = new String[]{'csrUniqueKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] plmStatus_type_info = new String[]{'plmStatus','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerID','customerName','pdGrade','lgdGrade','billingState','billingCountry','businessSegment','businessUnitCode','industry','sicCode','contractID','sourceSystem','csrUniqueKey'};
    }
    public class CreditSurveillanceSoapQSPort {
        public String endpoint_x = csrConfig.SERVICE_URL;
        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://www.company.com/CreditSurveillance', 'companyCsrService'};
        public companyCsrService.AccountResult SearchAccount(companyCsrService.SearchAccountRequest searchAccountRequest) {
            companyCsrService.SearchAccount_element request_x = new companyCsrService.SearchAccount_element();
            companyCsrService.SearchAccountResponse_element response_x;
            request_x.searchAccountRequest = searchAccountRequest;
            Map<String, companyCsrService.SearchAccountResponse_element> response_map_x = new Map<String, companyCsrService.SearchAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.company.com/CreditSurveillance/SearchAccount',
              'http://www.company.com/CreditSurveillance',
              'SearchAccount',
              'http://www.company.com/CreditSurveillance',
              'SearchAccountResponse',
              'companyCsrService.SearchAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.accountResponse;
        }
        public companyCsrService.CommentaryDataResponse RetrieveCommentaryData(companyCsrService.CommentaryDataRequest commentaryDataRequest) {
            companyCsrService.RetrieveCommentaryData_element request_x = new companyCsrService.RetrieveCommentaryData_element();
            companyCsrService.RetrieveCommentaryDataResponse_element response_x;
            request_x.commentaryDataRequest = commentaryDataRequest;
            Map<String, companyCsrService.RetrieveCommentaryDataResponse_element> response_map_x = new Map<String, companyCsrService.RetrieveCommentaryDataResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.company.com/CreditSurveillance/RetrieveCommentaryData',
              'http://www.company.com/CreditSurveillance',
              'RetrieveCommentaryData',
              'http://www.company.com/CreditSurveillance',
              'RetrieveCommentaryDataResponse',
              'companyCsrService.RetrieveCommentaryDataResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.commentaryDataResponse;
        }
    }
    public class SearchAccountRequest {
        public Integer customerID;
        public String customerName;
        public String businessUnitCode;
        private String[] customerID_type_info = new String[]{'customerID','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] customerName_type_info = new String[]{'customerName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessUnitCode_type_info = new String[]{'businessUnitCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerID','customerName','businessUnitCode'};
    }
    public class Error {
        public String code;
        public String description;
        private String[] code_type_info = new String[]{'code','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'code','description'};
    }
    public class CommentaryData {
        public Integer customerId;
        public String contractNumber;
        public String sourceSystem;
        public String effectiveDate;
        public String detailedCommentary;
        public String commentaryType;
        public String createdBy;
        private String[] customerId_type_info = new String[]{'customerId','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] contractNumber_type_info = new String[]{'contractNumber','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] effectiveDate_type_info = new String[]{'effectiveDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] detailedCommentary_type_info = new String[]{'detailedCommentary','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] commentaryType_type_info = new String[]{'commentaryType','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] createdBy_type_info = new String[]{'createdBy','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerId','contractNumber','sourceSystem','effectiveDate','detailedCommentary','commentaryType','createdBy'};
    }
    public class CommentaryDataResponse {
        public companyCsrService.ErrorList errorList;
        public companyCsrService.CommentaryData[] commentaryData;
        private String[] errorList_type_info = new String[]{'errorList','http://www.company.com/CreditSurveillance','ErrorList','0','1','false'};
        private String[] commentaryData_type_info = new String[]{'commentaryData','http://www.company.com/CreditSurveillance','CommentaryData','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'errorList','commentaryData'};
    }
    public class RetrieveCommentaryData_element {
        public companyCsrService.CommentaryDataRequest commentaryDataRequest;
        private String[] commentaryDataRequest_type_info = new String[]{'commentaryDataRequest','http://www.company.com/CreditSurveillance','CommentaryDataRequest','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'commentaryDataRequest'};
    }
    public class SearchAccount_element {
        public companyCsrService.SearchAccountRequest searchAccountRequest;
        private String[] searchAccountRequest_type_info = new String[]{'searchAccountRequest','http://www.company.com/CreditSurveillance','SearchAccountRequest','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'searchAccountRequest'};
    }
    public class SearchAccountResponse_element {
        public companyCsrService.AccountResult accountResponse;
        private String[] accountResponse_type_info = new String[]{'accountResponse','http://www.company.com/CreditSurveillance','AccountResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'accountResponse'};
    }
    public class RetrieveCommentaryDataResponse_element {
        public companyCsrService.CommentaryDataResponse commentaryDataResponse;
        private String[] commentaryDataResponse_type_info = new String[]{'commentaryDataResponse','http://www.company.com/CreditSurveillance','CommentaryDataResponse','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'commentaryDataResponse'};
    }
    public class ErrorList {
        public companyCsrService.Error[] error;
        private String[] error_type_info = new String[]{'error','http://www.company.com/CreditSurveillance','Error','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'error'};
    }
    
}

 Thanks,
Eric

I've written an Apex Service that will be called from an inhouse application.  I have a try/catch block that catches any exceptions and returns an error type that I've defined.  I also send an email notification out.  I know you can grab the exception type and message with .getTypeName() and .getMessage(), but how do I get the exception line number?  That would be handy information to send in the error notification email.  If I don't handle the error, the service returns the exception type, exception message, class name, class method, and line number in the faultstring element.  I don't see anything in the Apex documentation that would allow you to access the line number when catching the exception though.  What gives?  Is this available?

I've run into an interesting issue.  I am building a dynamic SOQL statement, so I want to clean the user input with the String.escapeSingleQuotes method.  It is having some undesired effects on the string that I'm trying to concatenate it to. 

 

Here is what's going on:

 

criteria = ' Employee_First_Name__c like \'' + String.escapeSingleQuotes(txtFirstName.trim()) + '%\'';

 

 is evaluating to the string:

 Employee_First_Name__c like \'er%\'

 

and:

criteria = ' Employee_First_Name__c like \'' + txtFirstName.trim() + '%\'';

is evaluating to the string:

 Employee_First_Name__c like 'er%'

 

 

Why is it that when I use the String.escapeSingleQuotes method with the "er" string (or any string), it causes the other string that I'm concatenating to not escape single quotes correctly (using the \' doesn't evaluate to ' properly)?

Message Edited by e r i c on 06-03-2009 01:19 PM
Message Edited by e r i c on 06-03-2009 01:20 PM

Is there something that can be done via Apex that can work the same way as the "Compliance BCC Email" setting under Setup>Administration Setup>Email Administration?  Basically, when this is enabled, all emails sent from salesforce.com are BCC'd to a specified email address.  The problem is that the user loses the ability to use BCC when sending an email if this is enabled.  The business folk aren't liking this at all.  Any thoughts?

 

 

We have a custom object and a sharing object for the custom object.  Via an Apex trigger, we are trying to give users access to records based on certain conditions.  This works fine.  The problem is identifying these records that were inserted via the trigger.  We set up an Apex sharing reason called "MAFTest" and we are setting the new record to that sharing reason in the Apex code:

 

apexShare.RowCause = Schema.Personal_Data__Share.rowCause.MAFTest__c;

But when the sharing record is created, the RowCause is always set to "Manual".   Am I missing something?  I verified via the System Log that "Personal_Data__Share.rowCause.MAFTest__c" evaluates to "MAFTest__c", but it still gets saved as "Manual".

 

Any help is greatly appreciated.

Has anyone encountered a shrinking issue when changing an app's logo to a custom logo?  When I refresh the page or randomly visit other pages, the custom logo will shrink to about 1/4 of the original size.  It's so annoying.  It happens in 2 of my company's orgs, in sandbox, and in my developer account.  I can't be the only one.  I tried making the size of the image smaller, but it still happens regardless of the height and width.  Anyone?

Hello all.  We have a trigger on the Task object that looks at the WhatId and/or WhoId to update certain fields on the related Account.  A user reported an issue to us when adding emails to Account and Contact records.  Upon taking a look at the debug logs, the WhatId and WhoId are both NULL in Before and After triggers.  However, after the Task record is saved, the WhatId and WhoId are properly set.  The logic of the trigger does not execute properly since the values are NULL when the trigger is executing.  Even if I perform a query in the After trigger for the WhatId and WhoId, they are still NULL.

 

How does Salesforce for Outlook work regarding the WhatId and WhoId?

 

System.debug commands:

	for (Task record : Trigger.new) {
		System.debug(record.WhoId);
		System.debug(record.WhatId);
		System.debug(record.Status);
		System.debug([SELECT Id, WhoId FROM Task WHERE Id = :record.Id].WhoId);

 Result in debug log:

15:26:09.682 (682782000)|USER_DEBUG|[13]|DEBUG|null
15:26:09.682 (682788000)|SYSTEM_METHOD_EXIT|[13]|System.debug(ANY)
15:26:09.682 (682839000)|SYSTEM_METHOD_ENTRY|[14]|System.debug(ANY)
15:26:09.682 (682850000)|USER_DEBUG|[14]|DEBUG|null
15:26:09.682 (682856000)|SYSTEM_METHOD_EXIT|[14]|System.debug(ANY)
15:26:09.682 (682940000)|SYSTEM_METHOD_ENTRY|[15]|System.debug(ANY)
15:26:09.682 (682953000)|USER_DEBUG|[15]|DEBUG|Completed
15:26:09.682 (682959000)|SYSTEM_METHOD_EXIT|[15]|System.debug(ANY)
15:26:09.683 (683169000)|SOQL_EXECUTE_BEGIN|[16]|Aggregations:0|select Id, WhoId from Task where Id = :tmpVar1
15:26:09.700 (700279000)|SOQL_EXECUTE_END|[16]|Rows:1
15:26:09.700 (700390000)|SYSTEM_METHOD_ENTRY|[16]|System.debug(ANY)
15:26:09.700 (700398000)|USER_DEBUG|[16]|DEBUG|null

 

 

I could be missing something here, but Salesforce Touch has always been, and is still, advertised to work with "any device", "anywhere".  I understand a phased rollout and what not, so it makes sense that it is only available for iPad 2 and 3 in the initial release.  But, there is no mention of when it will be available for any other device.  I'm specifically interested in Android 4.0 on an Acer tablet, but I can't find "any" information "anywhere" about it.  I just go to the site every so often (it's been a long time now) and all I've ever seen is "coming soon".  But then I came to know that it's already available for iPad 2 and 3 running 5.0 or higher.

The "Record Type Selection" option is under "Personal Setup"->"My Personal Information".  It basically allows the default Record Type to be selected automatically when creating a new record.  Is there any way I can update this preference programmatically, either through the web services API or Apex?  We basically want to give users access to a new record type, but do not want them to be prompted for record type selection when creating a new record.  We would like to set this option automatically without having the users set it themselves.

I created an Apex class using the "Generate From WSDL" functionality.  One of the methods that is called returns a list of customers from a backend system.  The problem is that certain searches return more than 1000 customers and I receive the "Collection size x,xxx exceeds maximum size of 1,000" error.  How can I limit the number of elements added to the object array that is populated by the response?

Here is the proxy class generated:

//Generated by wsdl2apex

public class companyCsrService {
    public class CommentaryDataRequest {
        public String contractNumber;
        public String sourceSystem;
        private String[] contractNumber_type_info = new String[]{'contractNumber','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'contractNumber','sourceSystem'};
    }
    public class AccountResult {
        public companyCsrService.ErrorList errorList;
        public companyCsrService.AccountInfo[] accountInfo;
        private String[] errorList_type_info = new String[]{'errorList','http://www.company.com/CreditSurveillance','ErrorList','0','1','false'};
        private String[] accountInfo_type_info = new String[]{'accountInfo','http://www.company.com/CreditSurveillance','AccountInfo','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'errorList','accountInfo'};
    }
    public class AccountInfo {
        public Integer customerID{  get; set;  }
        public String customerName{  get; set;  }
        public String pdGrade{  get; set;  }
        public String lgdGrade{  get; set;  }
        public String billingState{  get; set;  }
        public String billingCountry{  get; set;  }
        public String businessSegment{  get; set;  }
        public String businessUnitCode{  get; set;  }
        public String industry{  get; set;  }
        public String sicCode{  get; set;  }
        public String contractID{  get; set;  }
        public String sourceSystem{  get; set;  }
        public String csrUniqueKey{  get; set;  }
        public String plmStatus {  get; set;  }
        private String[] customerID_type_info = new String[]{'customerID','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] customerName_type_info = new String[]{'customerName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] pdGrade_type_info = new String[]{'pdGrade','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lgdGrade_type_info = new String[]{'lgdGrade','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] billingState_type_info = new String[]{'billingState','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] billingCountry_type_info = new String[]{'billingCountry','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessSegment_type_info = new String[]{'businessSegment','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessUnitCode_type_info = new String[]{'businessUnitCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] industry_type_info = new String[]{'industry','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sicCode_type_info = new String[]{'sicCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] contractID_type_info = new String[]{'contractID','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] csrUniqueKey_type_info = new String[]{'csrUniqueKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] plmStatus_type_info = new String[]{'plmStatus','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerID','customerName','pdGrade','lgdGrade','billingState','billingCountry','businessSegment','businessUnitCode','industry','sicCode','contractID','sourceSystem','csrUniqueKey'};
    }
    public class CreditSurveillanceSoapQSPort {
        public String endpoint_x = csrConfig.SERVICE_URL;
        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://www.company.com/CreditSurveillance', 'companyCsrService'};
        public companyCsrService.AccountResult SearchAccount(companyCsrService.SearchAccountRequest searchAccountRequest) {
            companyCsrService.SearchAccount_element request_x = new companyCsrService.SearchAccount_element();
            companyCsrService.SearchAccountResponse_element response_x;
            request_x.searchAccountRequest = searchAccountRequest;
            Map<String, companyCsrService.SearchAccountResponse_element> response_map_x = new Map<String, companyCsrService.SearchAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.company.com/CreditSurveillance/SearchAccount',
              'http://www.company.com/CreditSurveillance',
              'SearchAccount',
              'http://www.company.com/CreditSurveillance',
              'SearchAccountResponse',
              'companyCsrService.SearchAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.accountResponse;
        }
        public companyCsrService.CommentaryDataResponse RetrieveCommentaryData(companyCsrService.CommentaryDataRequest commentaryDataRequest) {
            companyCsrService.RetrieveCommentaryData_element request_x = new companyCsrService.RetrieveCommentaryData_element();
            companyCsrService.RetrieveCommentaryDataResponse_element response_x;
            request_x.commentaryDataRequest = commentaryDataRequest;
            Map<String, companyCsrService.RetrieveCommentaryDataResponse_element> response_map_x = new Map<String, companyCsrService.RetrieveCommentaryDataResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.company.com/CreditSurveillance/RetrieveCommentaryData',
              'http://www.company.com/CreditSurveillance',
              'RetrieveCommentaryData',
              'http://www.company.com/CreditSurveillance',
              'RetrieveCommentaryDataResponse',
              'companyCsrService.RetrieveCommentaryDataResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.commentaryDataResponse;
        }
    }
    public class SearchAccountRequest {
        public Integer customerID;
        public String customerName;
        public String businessUnitCode;
        private String[] customerID_type_info = new String[]{'customerID','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] customerName_type_info = new String[]{'customerName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] businessUnitCode_type_info = new String[]{'businessUnitCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerID','customerName','businessUnitCode'};
    }
    public class Error {
        public String code;
        public String description;
        private String[] code_type_info = new String[]{'code','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'code','description'};
    }
    public class CommentaryData {
        public Integer customerId;
        public String contractNumber;
        public String sourceSystem;
        public String effectiveDate;
        public String detailedCommentary;
        public String commentaryType;
        public String createdBy;
        private String[] customerId_type_info = new String[]{'customerId','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] contractNumber_type_info = new String[]{'contractNumber','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] sourceSystem_type_info = new String[]{'sourceSystem','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] effectiveDate_type_info = new String[]{'effectiveDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] detailedCommentary_type_info = new String[]{'detailedCommentary','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] commentaryType_type_info = new String[]{'commentaryType','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] createdBy_type_info = new String[]{'createdBy','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'customerId','contractNumber','sourceSystem','effectiveDate','detailedCommentary','commentaryType','createdBy'};
    }
    public class CommentaryDataResponse {
        public companyCsrService.ErrorList errorList;
        public companyCsrService.CommentaryData[] commentaryData;
        private String[] errorList_type_info = new String[]{'errorList','http://www.company.com/CreditSurveillance','ErrorList','0','1','false'};
        private String[] commentaryData_type_info = new String[]{'commentaryData','http://www.company.com/CreditSurveillance','CommentaryData','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'errorList','commentaryData'};
    }
    public class RetrieveCommentaryData_element {
        public companyCsrService.CommentaryDataRequest commentaryDataRequest;
        private String[] commentaryDataRequest_type_info = new String[]{'commentaryDataRequest','http://www.company.com/CreditSurveillance','CommentaryDataRequest','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'commentaryDataRequest'};
    }
    public class SearchAccount_element {
        public companyCsrService.SearchAccountRequest searchAccountRequest;
        private String[] searchAccountRequest_type_info = new String[]{'searchAccountRequest','http://www.company.com/CreditSurveillance','SearchAccountRequest','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'searchAccountRequest'};
    }
    public class SearchAccountResponse_element {
        public companyCsrService.AccountResult accountResponse;
        private String[] accountResponse_type_info = new String[]{'accountResponse','http://www.company.com/CreditSurveillance','AccountResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'accountResponse'};
    }
    public class RetrieveCommentaryDataResponse_element {
        public companyCsrService.CommentaryDataResponse commentaryDataResponse;
        private String[] commentaryDataResponse_type_info = new String[]{'commentaryDataResponse','http://www.company.com/CreditSurveillance','CommentaryDataResponse','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'commentaryDataResponse'};
    }
    public class ErrorList {
        public companyCsrService.Error[] error;
        private String[] error_type_info = new String[]{'error','http://www.company.com/CreditSurveillance','Error','0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.company.com/CreditSurveillance','true','false'};
        private String[] field_order_type_info = new String[]{'error'};
    }
    
}

 Thanks,
Eric

I've written an Apex Service that will be called from an inhouse application.  I have a try/catch block that catches any exceptions and returns an error type that I've defined.  I also send an email notification out.  I know you can grab the exception type and message with .getTypeName() and .getMessage(), but how do I get the exception line number?  That would be handy information to send in the error notification email.  If I don't handle the error, the service returns the exception type, exception message, class name, class method, and line number in the faultstring element.  I don't see anything in the Apex documentation that would allow you to access the line number when catching the exception though.  What gives?  Is this available?

Is there somewhere where I can check how my Eclipse editor handles Force.com syntax coloring?  None of the syntax coloring is shown, everything is black.  I've tried changing the customizable Java syntax coloring, which has no effect.

 

I'm running Eclipse 3.4.2 on XP Pro with SP 3, if any of that makes a difference.

 

Thanks 

Hi,

 

I have recently change my PC and reinstalled the development tools. I did it with Eclipse 3.4, the salesforce plugin and I found that Apexcode and visualforce code are colored, but javascript code (embeded in VF code) is not.

 

Does anybody know how to enable that in my Eclipse?

 

Regards,

 

Wilmer 

I was just going through the governor limits and these was written in point no. 6

 

These limits scale with trigger batch size. The limit is multiplied by the number of records submitted. For example, if your

batch process contains 200 records, your script may retrieve as many as 20,000 records.

 

I didn't got the meaning of the scaling. Can somebody please explain?

Hi all,

 

I'm trying to build in apex code that calls out to an external web service, however I'm finding a lot of issues at each step, and am currently struggling to get past the current error.

 

Current error is:

 

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://schemas.datacontract.org/2004/07/National.NonTraded.ReturnCalculator.Data=Error

Now this is all well and good, however I'm unable to get ahold of the SOAP request and response made/received from the WebServiceCallout class (defined in the classes build by WSDL2Apex).

 

I've read up that running the class/methods from Execute Anonymous within the Force IDE should give me this output - however I can't seem to get anything more than:

 

20090604033817.994:Class.PricingCentreReturnCalculator.BasicHttpBinding_IClientCentreService.DoRWACalculation: line 109, column 13: Sending callout request
20090604033817.994:Class.PricingCentreReturnCalculator.BasicHttpBinding_IClientCentreService.DoRWACalculation: line 109, column 13: Reading callout response

 

First question is, how can I enable the SOAP message output/debug, either in IDE or otherwise?

Second question is, given the limited knowledge of Web Services, is there any indication from the error this is more an Apex/code fault, a WSDL fault, or just the Web Service not behaving in a predictable fashion?

 

Any help much appreciated.

 

  • June 04, 2009
  • Like
  • 0
Hello,

I have an apparently simple problem that must have been solved before and it's a complete show stopper. I want the search in a lookup dialog to associate other objects to search other fields by default other than the auto-generated id field. I've created a custom object, and I want three different fields from that object to be searched on when returning the object to associate. This *must* be possible in salesforce, and I hope it's easy to accomplish.

Thanks!

David

As far as I understand, I have to use "execute anonymous" from the Force.com IDE and set the Log category to "Callout".

 

However,the result then is identical to what I would get when setting the Log category to "Apex Code". Actually I can't see any difference between the different categories. Independently from what I set, I get the same output. Actually, I'm quiote sure this is not the expected behaviour, so either I'm doing something wrong or there is a problem with my Eclipse.

 

Any ideas what am I doing wrong here?

Message Edited by eto on 04-21-2009 08:38 AM
  • April 21, 2009
  • Like
  • 0

Hi all,

 

urlEncode dosn't appear to be replacing underscores with the correct url safe representation, any ideas why this might be? Also is there a way to use post instead of get with a PageReference?

 

Thanks!

Scott

Message Edited by Scott.M on 03-23-2009 12:26 PM

Hi,

 

I am trying to integrate Amazon S3 and salesforce. I have created an Apex class from the S3 WSDl using WSDL2Apex. When the S3 copyObject method is invoked, I get the following exception 

 

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://s3.amazonaws.com/doc/2006-03-01/=CopyObjectResponse

  

 

However, the object copy from one bucket to another is successful. Can somebody help me with understanding this exception?

 

I tried debugging the using Force.com IDE and the response seems to be the one expected for a successful COPY operation.

 

 

 

  

Message Edited by trish on 03-03-2009 10:52 PM
  • March 04, 2009
  • Like
  • 0
    I'm getting the following error when I invoke a web service using the Apex classes generated from a WSDL and need to dig into the actual soap header being returned.

20080222192322.832:Class.pmt.apiAuthorizeNetSoapV1.ServiceSoap.CreateCustomerProfile: line 812, column 13:     Created Web Service callout to endpoint: https://api.authorize.net/soap/v1/Service.asmx
20080222192322.832:Class.pmt.apiAuthorizeNetSoapV1.ServiceSoap.CreateCustomerProfile: line 812, column 13:     Sending callout request
20080222192322.832:Class.pmt.apiAuthorizeNetSoapV1.ServiceSoap.CreateCustomerProfile: line 812, column 13:     Reading callout response
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element https://api.authorize.net/soap/v1/=resultCode

Is there a way to dump the soap header to my debug log inside eclipse?

And is there documentation on the Apex WebServiceCallout.invoke method?


Is there a way to call the emailauthor page from within an scontrol and pass it not one, but two document ids?  Passing a single document id works, but I need it to work for multiple document ids.
 

emUrl = "/email/author/emailauthor.jsp?doc_id="+doc_id+"&retURL="+gObjectIdURL+"&p3_mlktp="+p3_mlktp+"&p3_lkid="+p3_lkid+"&p3_lkold="+p3_lkold;