• Tamil
  • NEWBIE
  • 5 Points
  • Member since 2014
  • Developer and Admin

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
In the Case object, I have Contact lookup. Until the case is not closed the contact lookup will keep changing as per business requirements. My issue is when the user tries to send an email the Sendmail Email action is not picking the current contact instead it is picking Old send email contact . I contacted SF Support and SF support suggested to use: QuickAction.QuickActionDefaultsHandler
Here is the code I am using for SendEmail quick action.
global class SendEmailQuickAction implements QuickAction.QuickActionDefaultsHandler {
    global SendEmailQuickAction() {
    }
    global void onInitDefaults(QuickAction.QuickActionDefaults[] defaults) {
        Id ContId;
        QuickAction.SendEmailQuickActionDefaults sendEmailDefaults = (QuickAction.SendEmailQuickActionDefaults)defaults.get(0);
        if(sendEmailDefaults.getActionName() == 'Case.SendEmail1' && sendEmailDefaults.getActionType() == 'SendEmail')
        {
            ContId = sendEmailDefaults.getContextId();
            EmailMessage varemailMessage = (EmailMessage)sendEmailDefaults.getTargetSObject();   
            Case varCase =  [SELECT Contact.Email,Contact.Name,Contact.Id,ContactId from Case Where Id = :ContId Limit 1];
            varemailMessage.ToAddress = '';
            varemailMessage.ToAddress = varCase.ContactId;
        }        
    }
}


Now issue is
  • I am not able to populate Contact. When I use ContactID I am seeing the ID not the contact Name.
  • I am seeing all old send email contact in ToAddress when I try to send an email.
I need some help with ToAddress. Can someone help me pointing what mistake I am doing in the code. My requirement is ToAddress should have only Case Contact. This issue is happening for Email to Case. For other type of case i dont have this issue.

sample screen shot:
User-added image
  • August 21, 2021
  • Like
  • 0
I installed a managed package in one of the org and trying to show a tab from managed package in community. When i click the tab i am seeing the following screen.
User-added image
This is happening for tabs from Managed package. I gave Read,Edit and Create access for that object to Customer Community User profile. Is it possible to show managed package tabs in community? or am i missing any settings for managed package.
  • November 09, 2019
  • Like
  • 0
I add slds tag to existing VF page and trying to view the page in Lightning mode. When i see the page the Help icon are not shown properly. In Classic mode the icon appear twice. 

Classic

Lightning

Here is the code to simulate this:
<apex:page standardController="Case" lightningStylesheets="true" tabStyle="Case" >
    <apex:form>
        <apex:pagemessages/>
    </apex:form>
    <apex:slds/>
    <apex:outputText value="{!Case.ContactEmail}" rendered="false"/>
    <apex:detail />
</apex:page>

 
  • June 14, 2018
  • Like
  • 0
I am getting API Limit exception and I am not able to see which job/application is creating this issue. I am not able to see any debug log or scheduled jobs/Apex Jobs/Background Jobs/Bulk Data Load jobs.
Can anyone help me out how to check which job or process is using the callout. I searched some blogs but not able to get correct information.
 
 
  • July 03, 2017
  • Like
  • 0
I have a controller which is calling a VF page based on Reocord type. I have to patch the existing code with new recordtype which should call the standard page layout. I used 
PageReference('/02e/e?retURL='+Apexpages.currentPage().getParameters().get('retURL')+'&recordType='+RecordTypeId);
I'm getting URL No Longer Exists message. I need help in fixing this issue.
  • October 13, 2015
  • Like
  • 0
I am using the following code to send an email to user using HTML template. The issue which i am facing is i am getting email but the body of the email is blank. Am I doing any mistake in the code. When I test the email template it works fine.
 
List<String> sendTo = new List<String>();
EmailTemplate et = [SELECT Id,Subject, HtmlValue,Body FROM EmailTemplate WHERE Name =:'MyTemplate'];    
String subject = et.Subject;
subject = subject + ' '+ p.Name;
sendTo.add(p.Request__r.Reviewer__r.email);
sendEmailSet.setToAddresses(sendTo);
sendEmailSet.setSubject(subject);
String emailBody = et.HtmlValue;
emailBody = emailBody.replace('{!Request__c.Link}', URL.getSalesforceBaseUrl().toExternalForm() +'/'+p.Id);
sendEmailSet.setHtmlBody(emailBody);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { sendEmailSet });

 
  • September 24, 2015
  • Like
  • 0
I have a custom hyperlink field in an object. It opens a visualforce page from a list view. I want to be able to pass the list view Id in that link to return back to the list view on clicking cancel. Is it possible to pass the list view id in the hyperlink field? Or is this possible some other way?
  • April 29, 2015
  • Like
  • 1
HI,

I need to check that the user has given a valid date in a text box. For example if user enters 2014-02-29 it should throw an error saying it is not a valid date. I can use Date datatype but my requirement is that i need to use text box because in some condition it need to get data value and in some condition it need to get string value.

Thanks
IRaj
  • September 29, 2014
  • Like
  • 0
Hi,

I have requrierment in which Case object is rename to Company Case. I need to move this setting from Dev org to QA org. I want to know how i can move this changes using Ant migration tool, in package.xml were i need to give this.

Thanks
Iraj
  • September 08, 2014
  • Like
  • 0
Hi All,

Hope everyone is doing well. I have a issue with StrikeIron WSDL for North America address Verification. 

WSDL Code:

public wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element NorthAmericanAddressVerification(String UserID,String Password,String AddressLine1,String AddressLine2,String CityStateOrProvinceZIPOrPostalCode,String Country,String Firm,String Urbanization,String Casing) {
            wwwStrikeironCom.NorthAmericanAddressVerification_element request_x = new wwwStrikeironCom.NorthAmericanAddressVerification_element();
            request_x.UserID = UserID;
            request_x.Password = Password;
            request_x.AddressLine1 = AddressLine1;
            request_x.AddressLine2 = AddressLine2;
            request_x.CityStateOrProvinceZIPOrPostalCode = CityStateOrProvinceZIPOrPostalCode;
            request_x.Country = Country;
            request_x.Firm = Firm;
            request_x.Urbanization = Urbanization;
            request_x.Casing = Casing;
            wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element response_x;
            Map<String, wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element> response_map_x = new Map<String, wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/NorthAmericanAddressVerification',
              'http://www.strikeiron.com',
              'NorthAmericanAddressVerification',
              'http://www.strikeiron.com',
              'NorthAmericanAddressVerificationResponse',
              'wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

My Code:

try
  {

  wwwStrikeironCom.NorthAmericanAddressVerificationServiceSoap na = new  wwwStrikeironCom.NorthAmericanAddressVerificationServiceSoap();
  String UserID = '**************7E';
  String Password = '';
  String AddressLine1 = '15501 Weston Pkwy';
  String AddressLine2 = 'Suite 150';
  String CityStateOrProvinceZIPOrPostalCode = 'Cary NC 27513';
  String Country ='US';
  String Firm = 'StrikeIron';
  String Urbanization ='';
  String Casing = 'PROPER';
   wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element outp =                              na.NorthAmericanAddressVerification(UserID,Password,AddressLine1,AddressLine2,CityStateOrProvinceZIPOrPostalCode,
                Country,Firm,Urbanization,Casing);
  System.debug( 'The output is ' + outp);
   }
  Catch(Exception e)
  {
   System.debug(e);
  }

Error:
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element AddressLine1

I dont know the solution for this issue. Can some one help me out to fix this issue. 
  • July 03, 2014
  • Like
  • 0
I have a custom hyperlink field in an object. It opens a visualforce page from a list view. I want to be able to pass the list view Id in that link to return back to the list view on clicking cancel. Is it possible to pass the list view id in the hyperlink field? Or is this possible some other way?
  • April 29, 2015
  • Like
  • 1
I add slds tag to existing VF page and trying to view the page in Lightning mode. When i see the page the Help icon are not shown properly. In Classic mode the icon appear twice. 

Classic

Lightning

Here is the code to simulate this:
<apex:page standardController="Case" lightningStylesheets="true" tabStyle="Case" >
    <apex:form>
        <apex:pagemessages/>
    </apex:form>
    <apex:slds/>
    <apex:outputText value="{!Case.ContactEmail}" rendered="false"/>
    <apex:detail />
</apex:page>

 
  • June 14, 2018
  • Like
  • 0

Hi All,

The controller has 78% code coverage in sandbox then it was moved into the production. after that it has only 0% code coverage. Now it effected on overall code coverage. i tested code coverage without using SeeAllData=true.

Please let me know the solution. Why it happens? 

Thank you.

I have a custom hyperlink field in an object. It opens a visualforce page from a list view. I want to be able to pass the list view Id in that link to return back to the list view on clicking cancel. Is it possible to pass the list view id in the hyperlink field? Or is this possible some other way?
  • April 29, 2015
  • Like
  • 1
How to write RexEx for the time MM:HH AM/PM time thould be 12 hours format

Thanks in Advance
                  I would appreciate for any kind of replay
HI,

I need to check that the user has given a valid date in a text box. For example if user enters 2014-02-29 it should throw an error saying it is not a valid date. I can use Date datatype but my requirement is that i need to use text box because in some condition it need to get data value and in some condition it need to get string value.

Thanks
IRaj
  • September 29, 2014
  • Like
  • 0
Hi All,

Hope everyone is doing well. I have a issue with StrikeIron WSDL for North America address Verification. 

WSDL Code:

public wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element NorthAmericanAddressVerification(String UserID,String Password,String AddressLine1,String AddressLine2,String CityStateOrProvinceZIPOrPostalCode,String Country,String Firm,String Urbanization,String Casing) {
            wwwStrikeironCom.NorthAmericanAddressVerification_element request_x = new wwwStrikeironCom.NorthAmericanAddressVerification_element();
            request_x.UserID = UserID;
            request_x.Password = Password;
            request_x.AddressLine1 = AddressLine1;
            request_x.AddressLine2 = AddressLine2;
            request_x.CityStateOrProvinceZIPOrPostalCode = CityStateOrProvinceZIPOrPostalCode;
            request_x.Country = Country;
            request_x.Firm = Firm;
            request_x.Urbanization = Urbanization;
            request_x.Casing = Casing;
            wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element response_x;
            Map<String, wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element> response_map_x = new Map<String, wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/NorthAmericanAddressVerification',
              'http://www.strikeiron.com',
              'NorthAmericanAddressVerification',
              'http://www.strikeiron.com',
              'NorthAmericanAddressVerificationResponse',
              'wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }

My Code:

try
  {

  wwwStrikeironCom.NorthAmericanAddressVerificationServiceSoap na = new  wwwStrikeironCom.NorthAmericanAddressVerificationServiceSoap();
  String UserID = '**************7E';
  String Password = '';
  String AddressLine1 = '15501 Weston Pkwy';
  String AddressLine2 = 'Suite 150';
  String CityStateOrProvinceZIPOrPostalCode = 'Cary NC 27513';
  String Country ='US';
  String Firm = 'StrikeIron';
  String Urbanization ='';
  String Casing = 'PROPER';
   wwwStrikeironCom.NorthAmericanAddressVerificationResponse_element outp =                              na.NorthAmericanAddressVerification(UserID,Password,AddressLine1,AddressLine2,CityStateOrProvinceZIPOrPostalCode,
                Country,Firm,Urbanization,Casing);
  System.debug( 'The output is ' + outp);
   }
  Catch(Exception e)
  {
   System.debug(e);
  }

Error:
System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element AddressLine1

I dont know the solution for this issue. Can some one help me out to fix this issue. 
  • July 03, 2014
  • Like
  • 0
Hi,


I am new to salesforce integration,i got a requirement as to integrate salesforce to linkedIn,whenever i create a record to the custom object.In custom object i have a custom link after clicking on that link it should post on my LinkedIn wall.

Please,,,,,,,,, help me guysssssssssss,,,,,,,,,