• Amit Chaudhary 8
  • ALL STAR
  • 36568 Points
  • Member since 2014
  • Salesforce CRM Consultant


  • Chatter
    Feed
  • 1092
    Best Answers
  • 1
    Likes Received
  • 32
    Likes Given
  • 3
    Questions
  • 5263
    Replies
Hello, 
I am getting this error message in my Conference app when I try to assign a Speaker to a Session, I get this error message. Can you please explain why I am getting this error? I am also pasting the code for the Trigger. Thanks! 

User-added image
User-added image
Hi team,

I'm trying to complete the following  a Trailhead challenge :

"Create an Account Using SOAP API and SoapUI
Using SOAP API and SoapUI, create an account with the name "Bluebeards Grog House" and the description "It is better than Blackbeards." Note: if you receive a TLS error when connecting to your org with SoapUI, please see these instructions."


I'm using the following soap envelope to create the Account. Whatever I did, I have the following error message : 

Challenge Not yet complete... here's what's wrong: 
It doesn't appear that you have logged in using SoapUI.​


 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00D24000000b1KS!AQIAQKIHBbjociN.LyBrUF2VztSYstjiP3QSDKQmvnO2LWJQ0r7myMCPq7DHWO7GN.0q5tQgftbS8Zi72_V4NWkgFoJFUo9m</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <!--Zero or more repetitions:-->
            <Name>Bluebeards Grog House</Name>
            <Description>It is better than Blackbeards.</Description>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

Could someone help?

Thanks in advance 
Hello, 

I have a controller that is showing 0% code coverage, but I'm not sure why my test class isn't covering anything.  Can anyone help? 

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   
and here is my test: 

}
}
and here is my test? 
 
@isTest(seeAllData = false)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

would anyone be willing to help me beef this up?

it would mean the world to me. 

thank you in advance!!!!!!

John 
 
I get this error message: Challenge Not yet complete... here's what's wrong: Could not find a custom object named 'Energy_Audit__c'.

The custom object has been completed and populated with data.  HELP!

Iris
 
Greetings all,
I'm working on a test class and can't figure out why when I run the test I am not getting inside the for loop.  (I assume the test record I'm creating doesn't meet the criteria but can't figure out why).  Could someone kindly help me troubleshoot?  Thanks in advance!

Test class:
@istest
public class TestClassforInvoice {
 public static testMethod void testmyInvoices(){
	Account testAccount = new Account (Name = 'MyHousehold');
    Insert testAccount; 
    Contact testContact = new Contact (LastName= 'smith');
    insert testContact;
    AECaseMgmt__Program__c programNew = new AECaseMgmt__Program__c(Name= 'test prg'); 
	insert programNew; 
    AECaseMgmt__Program_Case__c testCase = new 	AECaseMgmt__Program_Case__c 
        (AECaseMgmt__Open_Date__c = System.now().date(), 	
         Program__c = programNew.Id, BypassValidationForProcessBuilder__c = true); 
     testCase.AECaseMgmt__Household__c = testAccount.id; 
    insert testCase;
    Case_Member_Enrollments__c testmember = new 
        Case_Member_Enrollments__c (Name = 'testCM', Case_ID__c = testCase.id, BypassValidationForProcessBuilder__c=true );
    
    testmember.Case_Member__c = testContact.id;
     insert testmember; 
    
     Client_Billing__c clientbill = new Client_Billing__c 
         (Entry_Type__c = 'Billed Expense', Billing_Item__c = 'Court Report', Client_Case__c = testCase.Id);
     
     PageReference pageRef = Page.SingleInvoice;
        Test.setCurrentPage(pageRef);
     ApexPages.StandardController sc = new ApexPages.StandardController(testcase);
		Invoice  controller = new Invoice(sc);
     pageRef = Page.MultipleInvoices;
        Test.setCurrentPage(pageRef);
		controller = new Invoice(sc);

 }
}
The for loop in my controller extension:

            for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c
                                                   where Id IN (SELECT Client_Case__c FROM Client_Billing__c)])  
            {
                caselist.add(New CasewInvoices (record));    
            }


Again, when I run the test, I'm not covering inside the for loop, and since "caselist" is not being populated, I'm not able to cover a large amount of the rest of my code.

And the entire controller:
public class Invoice {
    public ApexPages.StandardController stdCntrlr {get; set;}
    public list <CasewInvoices> caselist {get; set;}
    public list <Client_Billing__c> tempinvoicelist {get; set;}
    public String currentRecordId {get;set;}
    public decimal thirtydayold {get; set;}
    public decimal sixtydayold {get;set;}
    public decimal ninetydayold {get;set;}
    
    public Invoice(ApexPages.StandardController controller) {
        stdCntrlr = controller;
        if (caselist==null){
            caselist = new List <CasewInvoices>();
            }
        
        tempinvoicelist = [Select ID, Client_Case__c, Name, Amount__c, Date__c,Transaction_Description__c, Amount_Credit_Debit__c 
                           from Client_Billing__c Where Include_on_Invoice__c = true ]; 
		currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');      
     	
        String pageName = ApexPages.currentPage().getUrl().substringAfter('apex/');
		system.debug('-----current ID name----'+currentRecordID);

// populate case list; if from single invoice, just get one case; otherwise get all        
        
            for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c 
                                                   where Id IN (SELECT Client_Case__c FROM Client_Billing__c)])  
        	{
            	caselist.add(New CasewInvoices (record));	
        	}
        
        
        for (CasewInvoices caseincrement:caselist)
        {
            Decimal thirtydayold = 3;
            for(Integer i = 0; i <tempinvoicelist.size(); i++){
            	if (tempinvoicelist[i].client_case__c ==caseincrement.clientcase.id)
                    {
                        caseincrement.billinglist.add (tempinvoicelist[i]);
                        If (tempinvoicelist[i].Amount_Credit_Debit__c>0)
                        {
                        	If (tempinvoicelist[i].date__c.daysBetween(date.today())> 90)
                        		caseincrement.ninetydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 60)
                        		caseincrement.sixtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 30)
                        		caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                        Else 
                        {
                            caseincrement.ninetydayold = caseincrement.ninetydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.sixtydayold = caseincrement.sixtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                    }
            }
        }
 }

	Public class CasewInvoices
    {
        public List<Client_Billing__c> billingList {get;set;}
        public AECaseMgmt__Program_Case__c Clientcase {get;set;}
        public decimal thirtydayold {get;set;}
        public decimal sixtydayold {get;set;}
        public decimal ninetydayold {get;set;}
        
        public CasewInvoices (AECaseMgmt__Program_Case__c cc)
        {
            Clientcase = cc;
            billingList = new list<Client_Billing__c>();
            thirtydayold = 0;
            sixtydayold = 0;
            ninetydayold = 0;
        }
	}
}
Hi All,
I'm getting an error when trying to write my test class for my controller extension: 

System.NullPointerException: Attempt to de-reference a null object//Class.Invoice.<init>: line 20, column 1
Class.TestClassforInvoice.testmyInvoices: line 25, column 1


Here's my test class:
@istest
public class TestClassforInvoice {
 public static testMethod void testmyInvoices(){
	Account testAccount = new Account (Name = 'MyHousehold');
    Insert testAccount; 
    Contact testContact = new Contact (LastName= 'smith');
    insert testContact;
    AECaseMgmt__Program__c programNew = new AECaseMgmt__Program__c(Name= 'test prg'); 
	insert programNew; 
    AECaseMgmt__Program_Case__c testCase = new 	AECaseMgmt__Program_Case__c 
        (AECaseMgmt__Open_Date__c = System.now().date(), 	
         Program__c = programNew.Id, BypassValidationForProcessBuilder__c = true); 
     testCase.AECaseMgmt__Household__c = testAccount.id; 
    insert testCase;
    Case_Member_Enrollments__c testmember = new 
        Case_Member_Enrollments__c (Name = 'testCM', Case_ID__c = testCase.id, BypassValidationForProcessBuilder__c=true );
    
    testmember.Case_Member__c = testContact.id;
     insert testmember; 
    
     Client_Billing__c clientbill = new Client_Billing__c 
         (Entry_Type__c = 'Planned Expense', Billing_Item__c = 'Court Report', Client_Case__c = testCase.Id);
     
     ApexPages.StandardController sc = new ApexPages.StandardController(testcase);
		Invoice  controller = new Invoice(sc);

		PageReference pageRef = Page.SingleInvoice;
        Test.setCurrentPage(pageRef);

 }
}
The problem seems to be here: 

ApexPages.StandardController sc = new ApexPages.StandardController(testcase); Invoice controller = new Invoice(sc);

This is my extension:
 
public class Invoice {
    public ApexPages.StandardController stdCntrlr {get; set;}
    public list <CasewInvoices> caselist {get; set;}
    public list <Client_Billing__c> tempinvoicelist {get; set;}
    public String currentRecordId {get;set;}
    public decimal thirtydayold {get; set;}
    public decimal sixtydayold {get;set;}
    public decimal ninetydayold {get;set;}
    
    public Invoice(ApexPages.StandardController controller) {
        stdCntrlr = controller;
        if (caselist==null){
            caselist = new List <CasewInvoices>();
            }
        
        tempinvoicelist = [Select ID, Client_Case__c, Name, Amount__c, Date__c,Transaction_Description__c, Amount_Credit_Debit__c 
                           from Client_Billing__c Where Include_on_Invoice__c = true ]; 
		currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');      
     	
        String pageName = ApexPages.currentPage().getUrl().substringAfter('apex/');
		system.debug('-----current page name----'+pagename);

// populate case list; if from single invoice, just get one case; otherwise get all        
        
        If (pageName.contains('SingleInvoice'))
        {
        	for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c 
                                                   where Id =: currentRecordId])  
        	{
           		 caselist.add(New CasewInvoices (record));
        	}
        }
		Else
        {
            for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c  where Id IN (SELECT Client_Case__c FROM Client_Billing__c)])  
        	{
            	caselist.add(New CasewInvoices (record));	
        	}
        }
        
        for (CasewInvoices caseincrement:caselist)
        {
            Decimal thirtydayold = 3;
            for(Integer i = 0; i <tempinvoicelist.size(); i++){
            	if (tempinvoicelist[i].client_case__c ==caseincrement.clientcase.id)
                    {
                        caseincrement.billinglist.add (tempinvoicelist[i]);
                        If (tempinvoicelist[i].Amount_Credit_Debit__c>0)
                        {
                        	If (tempinvoicelist[i].date__c.daysBetween(date.today())> 90)
                        		caseincrement.ninetydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 60)
                        		caseincrement.sixtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 30)
                        		caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                        Else 
                        {
                            caseincrement.ninetydayold = caseincrement.ninetydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.sixtydayold = caseincrement.sixtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                    }
            }
        }

 }

	Public class CasewInvoices
    {
        public List<Client_Billing__c> billingList {get;set;}
        public AECaseMgmt__Program_Case__c Clientcase {get;set;}
        public decimal thirtydayold {get;set;}
        public decimal sixtydayold {get;set;}
        public decimal ninetydayold {get;set;}
        
        public CasewInvoices (AECaseMgmt__Program_Case__c cc)
        {
            Clientcase = cc;
            billingList = new list<Client_Billing__c>();
            thirtydayold = 0;
            sixtydayold = 0;
            ninetydayold = 0;
        }
	}
}
Can someone help me troubleshoot this error, please?  Many thanks.

Collen

 
Hello,

I'm having an issue with an Opportunity trigger that I'm writing, the trigger will change a User lookup field called ResponsibleParty to someone on the Opportunity Team when the stage changes. This trigger does work in the dev org, but I can't get it to work with a test class. Below is the Trigger and test class, it is failing when I perform the SOQL query on OpportunityTeamMember, it will return zero rows. Also I can take the test class code and put it right into the execute Annonymous Code windows and it all works.

FYI I'm fairly new to APEX and I'm working on the Bulkifing. 

Trigger -----

trigger Responsible_Party_Change on Opportunity (after update) {
    for (Opportunity opp : Trigger.new) {

        Opportunity oldOpp = Trigger.oldMap.get(opp.Id);
        //Getting the UserID for Opp Team Member with "Partner" Role
        OpportunityTeamMember partner = [SELECT UserId
                            FROM OpportunityTeamMember
                            WHERE OpportunityId = :opp.Id
                            AND TeamMemberRole = 'Partner'
                            LIMIT 1];

       //Getting the UserID for Opp Team Member with "Setup" Role
        OpportunityTeamMember setup = [SELECT UserId
                            FROM OpportunityTeamMember
                            WHERE OpportunityId = :opp.Id
                            AND TeamMemberRole = 'Setup'
                            LIMIT 1];

        //Getting the UserID for Opp Team Member with "Processor" Role
        OpportunityTeamMember processor = [SELECT UserId
                            FROM OpportunityTeamMember
                            WHERE OpportunityId = :opp.Id
                            AND TeamMemberRole = 'Processor'
                            LIMIT 1];

        //IF the Stage is Partner then set Responsible Party to Partner
        if (!oldOpp.StageName.equals('Partner') && opp.StageName.equals('Partner'))
        {
                opp.Responsible_Party__c = partner.UserId;
        }
}

}

Test Class -----

@isTest
private class ResponsiblePartyChangeTest {
    
    @isTest static void StageChangeTest() {
        Opportunity opp = new Opportunity();
        opp.CloseDate = Date.Today();
        opp.OwnerId = UserInfo.getUserId();
        opp.Name = 'Test Opp';
        opp.StageName = 'Officer';
        Insert(opp);

        opp.StageName = 'Partner';
        Update(opp);
    }
    
}


Any help would be greatly Appreciated!!

 
Question for VF/Apex experts.

I'm unable to load child records from a master-detail relationship using Apex and Visualforce.  Here is my setup.  I've Master-Detail relationship between PP_Deals__c (Master object) and Tranche__c (Child object).  My goal is to display parent-child records meeting certain criteria using VF page and a custom list controller.  My sample VF page and Apex extension controller is below.  The problem is that I can see the parent records but no child records.  If I remove the WHERE clause in the query, I can see all the records.  Also, if I put a specific parent id in the parent clause I can see records, but in its current form it I don't see child records when in principal the WHERE clause should have the correct id.  What am I missing?

Thanks in advance for help.

<!-- Visualforce code -->
<apex:page standardController="PP_Deals__c" recordSetVar="deals" extensions="extCon">
    <apex:pageBlock >
        <apex:pageBlockTable value="{! deals }" var="ds">
            <apex:column value="{! ds.Name }"/>
            <apex:column value="{! ds.id }"/>

            <apex:column >            
                <apex:pageBlock >
                    <apex:pageBlockTable value="{! relatedTranches}" var="val">
                        <apex:column value="{! val.name}"/>
                        <apex:column value="{! val.Id}"/>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:column>
            
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

//  Associated Apex Code -- Controller List extension
public class extCon {   
    private final PP_Deals__c deal;
    
    public extCon(ApexPages.StandardSetController controller) {
        deal = (PP_Deals__c) controller.getRecord();
    }
    
    public List<Tranche__c> getrelatedTranches()
    {
        List <Tranche__c> conList = New List<Tranche__c>();
        
        for(PP_Deals__c acc:[ SELECT id,name, (SELECT id, name FROM Tranches__r) FROM PP_Deals__c WHERE id = :deal.id ])
        {
           for(Tranche__c con:acc.Tranches__r)
               conList.add(con);
        }

        return conList;
    }
}
I'm currently stuck on the first challenge. I keep getting "Challenge Not yet complete... here's what's wrong: 
The field 'Target_Close_Date__c' either does not exists on the Offer__c object or it is not of type date.
"
I really don't know what I'm doing wrong. current code
 
Hi All,

I'm a relative beginner to Apex so bear with me. We're placing an extension on a VF page so that we can run a query to include auto-archived activities but I can't seem to get proper code coverage and have lately been getting an error for de-referencing a null object. Can you take a look at my class and test class and let me know where I went wrong? Your help is incredibly appreciated!
 
public class OFTaskController {

    public OFTaskController(ApexPages.StandardController controller) {

    }

    private final Task tasks;
    public ApexPages.StandardSetController stdCntrlr {get; set;}
    public OFTaskController(ApexPages.StandardSetController controller) {
       stdCntrlr = controller;
        tasks = [SELECT Id, AccountId, Account.Name FROM Task WHERE Id = :ApexPages.currentPage().getParameters().get('id') LIMIT 1 ALL ROWS];
    }
    public Task getTasks() {
        return tasks;
    }
    public PageReference save() {
        update tasks;
        return null;
    }
}
 
@istest
private class OFTaskControllerTest {
    static testMethod void checkOFTask() {
        Date ad = Date.today();
        Task x = new Task();
        x.Subject='Test Task';
        x.Type='Audit';
        x.Status='Completed';
        x.ActivityDate=ad;
        x.Priority='Normal';
        x.Whatid='0014600000jvg5Y';
        insert x;
        
        test.startTest();
        Test.setCurrentPage(Page.OFTask_Test);
          ApexPages.StandardController stdSetController = new ApexPages.StandardController(x);
          //stdSetController.setSelected(x);
          OFTaskController ext = new OFTaskController(stdSetController);
        ext.getTasks();
        //ext.save();
        test.stopTest();
        
        }
}

Thank you again in advance!
Hi

I have a controller (shown below) which generates a PDF and sends it by email.

I am setting the file name in the line of:
attach.setFileName('POFile.pdf');

All I want to do is add todays date to the the filename which I have tried as:
attach.setFileName('POFile{!Today()}.pdf');

All is does is bolt the text of "{!Today()} to end of the filename rather than inserting the date.

Any ideas where I am going wrong?

 
public with sharing class SendPDFbyEmail {

public SendPDFbyEmail (ApexPages.StandardController controller) {
}

//Set variable values
public String EmailAddress {get;set;}
public String eSubject{get;set;}
public String eBody{get;set;}



//Start mail process and set criteria for PDF
public PageReference SendEmail() {

Messaging.SingleEmailMessage email=new Messaging.SingleEmailMessage();
PageReference pdfGeneration=Page.Purchase_Order_PDF;
pdfGeneration.SetRedirect(true);
Blob b=pdfGeneration.getContent();

//Create attachment and set criteria
Messaging.EmailFileAttachment attach=new Messaging.EmailFileAttachment();
attach.setFileName('PoFile"{!Today()}".pdf');
attach.setBody(b);

    email.SetSubject(eSubject);
    email.SetPlainTextBody(eBody);
    email.setToAddresses(new String[] { EmailAddress });
    email.setFileAttachments(new Messaging.EmailFileAttachment[] {attach});

    
//Now Sending the Email
Messaging.SendEmailResult[] r=Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
    
    return null;
    
    }
    }


 
Hi everyone. I have been trying to figure out this test class for my extension class, but ive been struggling with it for 2 weeks. I have a test class that runs, but I'm not sure if it truly verifies everything its supposed to. I have been told by some that it is enough, and by others I've been told its not good enough and I should have a method for every possibility of combinations of my picklists Yes/No 's( I have 3 picklists). Can somebody please help me by sending me code for what my test class should look like. I've been having trouble with this for so long, I just need to get this down. Thank you so much.

I've already been linked out to all the salesforce pages explaining test classes and test classes with extensions and all that, I'm still confused, so seeing the code would help me a lot more than links. Thank you all so much for the help in advanced!

Extension class:
public with sharing class EscalationPageExtension { 
    
    public String picklist1{get;set;}
    public String picklist2{get;set;}
    public String picklist3{get;set;}
   
    private ApexPages.StandardController ctrl;
    public EscalationPageExtension(ApexPages.StandardController controller)
    {
        ctrl = controller;    
    }
    
    public List<SelectOption> options { get; private set; }
    {
    options = new List<SelectOption>();
    options.add(new SelectOption('', '-Select-')); // ==> option null
    options.add(new SelectOption('false', 'No'));
    options.add(new SelectOption('true', 'Yes'));
    }
    
    
    public void setDataIntegrity()
    {
        Case cas = (Case)ctrl.getRecord();
        cas.Escalation_Data_Integrity__c = Boolean.valueof(picklist1); 
    }
    
    public void setViableWorkaround()
    {
        Case cas = (Case)ctrl.getRecord();
        cas.Escalation_Viable_Workaround__c = Boolean.valueof(picklist2);
    }
    
    public void setAppFunction()
    {
        Case cas = (Case)ctrl.getRecord();
        cas.Escalation_Application_Functionality__c = Boolean.valueof(picklist3);
    }
}

Visualforce Page:
<apex:page standardController="Case" extensions="EscalationPageExtension"><!-- We should keep sidebars and headers to give them a way out -->
    <apex:pageBlock title="{!$User.FirstName}, Answer Questions to Escalate Case.">
    
    <apex:form id="formID">
      
      <h1>How many users are affected?</h1>
      <apex:inputField value="{! Case.Escalation_Users_Affected__c }" required="true"/>
    
      <br/>
      <h1>Does this affect data integrity?</h1>
      <apex:actionRegion >
          <apex:outputPanel styleClass="requiredInput" layout="block">
          <apex:outputPanel styleClass="requiredBlock" layout="block"/>
          <apex:selectList value="{!picklist1}" size="1" required="true">
          <apex:actionSupport event="onchange" rerender="hidepanel1" action="{!setDataIntegrity}"/>
          <apex:selectOptions value="{!options}" />
          </apex:selectList>
          </apex:outputPanel>
      </apex:actionRegion>
      <br/>
      <apex:outputPanel id="hidepanel1">
      <apex:outputText value="How?" style="display:{!if(picklist1=='true', 'block', 'none')}"/>
      <apex:inputField value="{!Case.Escalation_Data_Integrity_Explain__c}" required="{!picklist1}" style="display:{!if(picklist1=='true', 'block; width:250px; height:75px;', 'none')}"/>
      <!-- <apex:inputCheckbox value="{!Case.Escalation_Data_Integrity__c}" selected="true" style="display:none;" rendered="{!picklist1}"/> -->
      </apex:outputPanel>
      
      <br/> <br/>
      <h1>Do you have a viable workaround?</h1>
      <apex:actionRegion >
          <apex:outputPanel styleClass="requiredInput" layout="block">
          <apex:outputPanel styleClass="requiredBlock" layout="block"/>
          <apex:selectList value="{!picklist2}" size="1" required="true">
          <apex:actionSupport event="onchange" rerender="hidepanel2" action="{!setViableWorkaround}"/>
          <apex:selectOptions value="{!options}" />
          </apex:selectList>
          </apex:outputPanel>
      </apex:actionRegion>
      <br/>
      <apex:outputPanel id="hidepanel2">
      <apex:outputText value="What is the viable workround?" style="display:{!if(picklist2=='true', 'block','none')}"/>
      <apex:inputField value="{!Case.Escalation_Viable_Workaround_Explain__c}" required="{!picklist2}" style="display:{!if(picklist2=='true', 'block; width:250px; height:75px;', 'none')}" />
      <!-- <apex:inputCheckbox value="{!Case.Escalation_Viable_Workaround__c}" selected="true" style="display:none;" rendered="{!picklist2}"/> -->
      </apex:outputPanel>
    
      <br/> <br/>
      <h1>Does this affect critical application functionality?</h1>
      <apex:actionRegion >
          <apex:outputPanel styleClass="requiredInput" layout="block">
          <apex:outputPanel styleClass="requiredBlock" layout="block"/>
          <apex:selectList value="{!picklist3}" size="1" required="true">
          <apex:actionSupport event="onchange" rerender="hidepanel3" action="{!setAppFunction}"/>
          <apex:selectOptions value="{!options}" />
          </apex:selectList>
          </apex:outputPanel>
      </apex:actionRegion>
      <br/>
      <apex:outputPanel id="hidepanel3">
      <apex:outputText value="How?" style="display:{!if(picklist3=='true', 'block','none')}"/>
      <apex:inputField value="{!Case.Escalation_App_Functionality_Explain__c}" required="{!picklist3}" style="display:{!if(picklist3=='true', 'block; width:250px; height:75px;', 'none')}" />
      <!-- <apex:inputCheckbox value="{!Case.Escalation_Application_Functionality__c}" selected="true" style="display:none;" rendered="{!picklist3}"/> -->
      </apex:outputPanel>
      
      <br/> <br/>
      <h1>What business functionality are you unable to perform?</h1>
      <br/>
      <apex:inputField value="{! Case.Escalation_Business_Functionality__c }"  style="width: 300px; height: 100px" required="true"/>
      
      <br/> <br/> <br/>
      <apex:inputCheckbox value="{!Case.IsEscalated}" selected="true" style="display:none;"/>
      <apex:commandButton action="{!save}" value="Submit" />
      
    </apex:form>  
    </apex:pageBlock>   
</apex:page>

My current Test Class:
@isTest 
public class EscalationPageExtensionTest 
{
    static testMethod void testMethod1() 
    {
    
        Case cas = new Case(Status ='New', Priority = 'Medium', Origin = 'Email');
        insert cas;
        

        Test.StartTest(); 
            ApexPages.StandardController sc = new ApexPages.StandardController(cas);
            EscalationPageExtension  testObj = new EscalationPageExtension(sc);
        
            testObj.picklist1 = 'true';
            testObj.picklist2 = 'true';
            testObj.picklist3 = 'true';
            cas.Escalation_Users_Affected__c = '123';
            cas.Escalation_Business_Functionality__c = 'The Business Functionality I cant perform is....';
            
            testObj.setDataIntegrity();
            System.assertEquals(cas.Escalation_Data_Integrity__c, true);
            cas.Escalation_Data_Integrity_Explain__c = 'Affects Data Integrity by...';
            
            testObj.setViableWorkaround();
            System.assertEquals(cas.Escalation_Viable_Workaround__c, true);
            cas.Escalation_Viable_Workaround_Explain__c = 'The Viable Workaround is...';
        
            testObj.setAppFunction();
            System.assertEquals(cas.Escalation_Application_Functionality__c, true);
            cas.Escalation_App_Functionality_Explain__c = 'Affects Application Functionality by...';
            
            List<SelectOption> lstOptions  = testObj.options;
            System.assert(lstOptions.size() > 0 );
            
            sc.save();
            List<Case> lstCase = [select id,Escalation_Application_Functionality__c from case where id =:cas.id ];
            System.assert(lstCase.size() > 0 );
            System.assertEquals(lstCase[0].Escalation_Application_Functionality__c , true ); 

        Test.StopTest();
    }
}

Again I'm not sure if that test class verifies enough. I have been told to make a seperate method tht runs for every cmobination of picklists to try to test every possibility, but im not sure if that is necessary. Please Help, i really need it. Thank you so much!

Isaac​
hi Nayana K...

 
trigger eventTriggerContact on Event (after insert, after update) {

   Set<Id> set_ContactId = new Set<Id>();
   List<Contact> conList = new List<Contact>(); 
     
    
    
   if(Trigger.isAfter && Trigger.isInsert)
     {
       for(Event e : Trigger.new)
         {
           
           if(e.whoId!=null && String.valueOf(e.whoId).startsWith('003') && (e.Type == 'Consult') )
             {
               set_ContactId.add(e.whoId);
             }
        }
        
    
    Map<Id,Contact> conMap = new Map<Id,Contact>([Select Id,StartDateTime__c,Start_Time__c,User_Attorney_Profile_Page__c,User_First_Name__c,
                                               User_Last_Name__c,User_Office_Google_Map_Link__c,User_Office_Phone__c,Phone_Number_Text__c,
                                               User_Office_Website__c,One_of_Our_Attorneys__c,Most_Recent_Event_Id__c from contact where Id IN:set_ContactId]);  
                                               
  
    
                                                 
         
        for(Event e : Trigger.new)
          {
           
            if(conMap!=null && conMap.containsKey(e.whoId))
              
              {
                   conMap.get(e.whoId).StartDateTime__c= e.StartDateTime;
                   conMap.get(e.whoId).Start_Time__c= e.Start_Time__c;
                   conMap.get(e.whoId).User_Attorney_Profile_Page__c= e.User_Attorney_Profile_Page__c;
                   conMap.get(e.whoId).User_First_Name__c= e.User_First_Name__c;
                   conMap.get(e.whoId).User_Last_Name__c= e.User_Last_Name__c;
                   conMap.get(e.whoId).User_Office_Google_Map_Link__c= e.User_Google_Map_Link__c;
                   conMap.get(e.whoId).User_Office_Phone__c= e.User_Office_Phone__c;
                   conMap.get(e.whoId).User_Office_Website__c = e.User_Office_Website__c ;
                   conMap.get(e.whoId).Phone_Number_Text__c= e.Phone_Number_Text__c;
                   conMap.get(e.whoId).Great_Hands_Text__c= e.Great_Hands_Text__c;
                   conMap.get(e.whoId).One_of_Our_Attorneys__c= e.One_of_Our_Attorneys__c;
                   conMap.get(e.whoId).Most_Recent_Event_Id__c=e.id;
                   conList.add(conMap.values());
              }
          }
        
          
         system.debug('!!!!!!'+ conList);
          if(conList!=null && conList.size()>0)
             update conList;
   
  }        
      if(Trigger.isAfter && Trigger.isUpdate)
      {                                                  
    for(Event e : Trigger.new)
         {
           
           if(e.whoId!=null && String.valueOf(e.whoId).startsWith('003') && (e.Type == 'Consult'))
             {
               set_ContactId.add(e.whoId);
             }
        }
        
    
    Map<Id,Contact> conMap = new Map<Id,Contact>([Select Id,StartDateTime__c,Start_Time__c,User_Attorney_Profile_Page__c,User_First_Name__c,
                                               User_Last_Name__c,User_Office_Google_Map_Link__c,User_Office_Phone__c,Phone_Number_Text__c,
                                               User_Office_Website__c,One_of_Our_Attorneys__c,Most_Recent_Event_Id__c from contact where Id IN:set_ContactId]);  
                                               
  
    
                                                 
         
        for(Event e : Trigger.new)
          {
           
            if(conMap!=null && conMap.containsKey(e.whoId) && e.id  == conMap.get(e.whoId).Most_Recent_Event_Id__c)
              
              {
                   conMap.get(e.whoId).StartDateTime__c= e.StartDateTime;
                   conMap.get(e.whoId).Start_Time__c= e.Start_Time__c;
                   conMap.get(e.whoId).User_Attorney_Profile_Page__c= e.User_Attorney_Profile_Page__c;
                   conMap.get(e.whoId).User_First_Name__c= e.User_First_Name__c;
                   conMap.get(e.whoId).User_Last_Name__c= e.User_Last_Name__c;
                   conMap.get(e.whoId).User_Office_Google_Map_Link__c= e.User_Google_Map_Link__c;
                   conMap.get(e.whoId).User_Office_Phone__c= e.User_Office_Phone__c;
                   conMap.get(e.whoId).User_Office_Website__c = e.User_Office_Website__c ;
                   conMap.get(e.whoId).Phone_Number_Text__c= e.Phone_Number_Text__c;
                   conMap.get(e.whoId).Great_Hands_Text__c= e.Great_Hands_Text__c;
                   conMap.get(e.whoId).One_of_Our_Attorneys__c= e.One_of_Our_Attorneys__c;
                   
                   conList.add(conMap.values());
              }
          }
        
          
         system.debug('!!!!!!'+ conList);
          if(conList!=null && conList.size()>0)
             update conList;
   
  }        
}

 
Hi everyone. I was wondering if there is a way to test if a visualforce page will save correctly. I have a VF page with an extension class. I am making a test class for that extension class. I want to test to see if after I do smaller tests and input all the required info for the VF page if it will save correctly ( aka all the required fields r working correctly).

So basically is there a way to test if the save method works and a VF saves successfully?

In case you need it, here is my test class:
@isTest 
public class EscalationPageExtensionTest 
{
    static testMethod void testMethod1() 
    {
    
        Case cas = new Case(Status ='New', Priority = 'Medium', Origin = 'Email');
        insert cas;
        

        Test.StartTest(); 
            ApexPages.StandardController sc = new ApexPages.StandardController(cas);
            EscalationPageExtension  testObj = new EscalationPageExtension(sc);
        
            testObj.picklist1 = 'true';
            testObj.picklist2 = 'true';
            testObj.picklist3 = 'true';
        	cas.Escalation_Users_Affected__c = '123';
        	cas.Escalation_Business_Functionality__c = 'Business Functionality I cant perform....';
        	
        	testObj.setDataIntegrity();
        	System.assertEquals(cas.Escalation_Data_Integrity__c, true);
        	
            testObj.setViableWorkaround();
            System.assertEquals(cas.Escalation_Viable_Workaround__c, true);
        
            testObj.setAppFunction();
        	System.assertEquals(cas.Escalation_Application_Functionality__c, true);
            
            List<SelectOption> lstOptions  = testObj.options;
            System.assert(lstOptions.size() > 0 );
        	
        	sc.save(); //This is where I want to know if I can test saving the VF page

        Test.StopTest();
    }
}

Thanks for your help in advanced!
Hello All,

I am trying to write a trigger and getting this error.
 here's the code -

Trigger LastOnsiteVisit_SA on Event(Before insert, before update) {
 Set<ID> eventIds = new Set<ID>();
 Set<ID> AccountIDZ = new Set<ID>();

 for (Event evt: Trigger.New) {

  eventIds.add(evt.Id);

  AccountIDZ.add(evt.AccountId);
 }

 Set<Account> Accountset = new Set<Account>([SELECT ID FROM Account where ID IN: AccountIDZ]);

 Map<Id,DateTime> mp2 = new Map<Id,DateTime>([SELECT AccountId, EndDateTime FROM Event WHERE RecordTypeId = '01270000000YSks'
                                              AND AccountId IN :AccountIDZ
                                              AND Type = 'Onsite Meeting'
                                              ORDER BY EndDateTime DESC]);
    
 for (Account acct: Accountset) {
  if (mp2.containskey(acct.id)) {
   acct.Last_Onsite_Visit__c = mp2.get(acct.Id).Date();

  }
 }
}
I am stuck on a challenge for Create a process to update child record when the parent is updated. I get the following error message, which I am unable to resolve. Please somebody advice. Followed all steps, I have deactivated the validation rule as well.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Account number must be 8 characters long: []

Original Challenge:

Create a process to update child record when the parent is updated.
You've been given a requirement to keep Contact addresses in sync with the Account they belong to. Use Process Builder to create a new process that updates all child Contact addresses when the address of the Account record is updated. This process:
Can have any name.
Must be activated.
Must update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.
NOTE: You may have to deactivate the validation rule for the Contacts object (created from a previous challenge) in order to complete this challenge.
Hello all Awesome Developers!

I have a visualforce page using an extension that populates a lookup field and does a custom save to redirect to another Visualforce page. 

My stuggle is that I am newer to APEX coding and I do not know how to attempt a test class to make my extension class pass code coverage. 

Can anyone help please? 

Visualforce Page:
<apex:page standardController="Salesforce_Support_Survey__c" sidebar="false" showHeader="false" extensions="SalesforceSupportSurveyController" docType="html-5.0">
   
    <style>
    html, body, p { 
        font-family: "ProximaNovaSoft-Regular", Calibri, 
            "Gill Sans", "Gill Sans MT", Candara, Segoe, 
            "Segoe UI", Arial, sans-serif; 
        font-size: 110%;
    }
    input { font-size: 95%; }
	</style>
    
    <apex:form >
        <apex:pageBlock title="Thank you for taking our short survey!" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Submit Survey"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Survey Questions:" columns="2">
                <apex:outputField value="{!Salesforce_Support_Survey__c.X1_Timliness__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X1_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X2_Satisfaction__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X2_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X3_Submission_process__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X3_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X4_Enhancement_Ideas__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X4_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.X5_Additional_Comments__c}"/>
                <apex:inputField value="{!Salesforce_Support_Survey__c.X5_Answer__c}"/>
                <apex:outputField value="{!Salesforce_Support_Survey__c.Issue__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Extension Class that Test class is needed for:

public class SalesforceSupportSurveyController
{
   Salesforce_Support_Survey__c Issue {get;set;}

    //constructor
    public SalesforceSupportSurveyController(ApexPages.StandardController stdController){
        Issue = (Salesforce_Support_Survey__c)stdController.getRecord();
        Issue.Issue__c = ApexPages.currentPage().getParameters().get('lookupVal');
    }

    public PageReference save(){
        insert Issue;
        
        PageReference reRend = new PageReference('/apex/ThankYou');
        reRend.setRedirect(true);
        return reRend;
    }
}

Thank you all for your help in getting me past this, I really appreciate it,

Shawn
I am stuck on Understand Account and Contact Relationships

Challenge Not yet complete... here's what's wrong:
The 'Account Manager' contact role for 'Acme Corporation' could not be found or it is not set to the current user. Please also make sure you've enabled Account Teams and have added yourself to the Account Team.


I just came to understand that I was confusing Related Contacts with Account Team. I have enabled Account Teams, but the field will not display on the Acme Corporation record.

Help!

 
Hi All! 
I'm having trouble writing a test for this trigger.  I can get 65% coverage, but not more.  I'm new to this, so I'm sure there is something small I'm missing somewhere.  Any help would be awesome! Thanks!
trigger CaseResolutionTrigger on Case (after update) 
{
    Set<String> caseIdSet = new Set<String>(); 
    if(CaseResolutionTriggerHandler.isFirstTime)
    {
        CaseResolutionTriggerHandler.isFirstTime = false;
        
	Set<ID> RTIds = new Set<ID>();  //set of Record Type IDs to match
        
        List<CaseComment> CommentList = new List<CaseComment>();
        List<Time_Entry__c> TEList = new List<Time_Entry__c>();
     
        for(RecordType rt : [select id from Recordtype where SobjectType='Case' and ((Name like 'e-MDs%') or (Name like 'Richmond%'))]){
  		  RTIds.add(rt.id);
			}   
    for(Case ca : Trigger.New)    {
    
      //Only when Resolution is changed and only for specified Record Types - Insert Comment and Time Entry     
	if(RTIds.contains(ca.Recordtypeid) && ca.Resolution__c != '' && ca.Resolution__c != Trigger.oldmap.get(ca.id).Resolution__c){
        CaseComment com = new CaseComment();
        com.ParentId = ca.id;
        com.CommentBody= 'RESOLUTION:  '+ '\n' + ca.Resolution__c;
        CommentList.add(com);
        
        Time_Entry__c te = new Time_Entry__c();
        te.Case__c  = ca.id;
        te.Minutes_Spent__c = ca.Minutes_SMB__c;
        TEList.add(te);
         
}
        //clear the number passed from the case to the Time Entry
      Case c = [Select id, Minutes_SMB__c from Case where id = :ca.id];
        c.Minutes_SMB__c = NULL;
        update c;
                            }

		Insert CommentList;
        Insert TEList;
        

}
}

 
I got to know that , Salesforce has recently introduced the Platform Developer 1 certification (DEV450) to replace the Developer (DEV401) certification. All practitioners, with the DEV401 certification, must complete the DEV450 exam during 2016 to retain a Salesforce developer certification.

Is this true as i dnt not got any email from salesforce / webassessvor that if you will not give the DEV450 exam then your DEV401 certifcate will expire ?
 
When i am posting code "" is not printing. And Some code is removing automatically. 

Any idea . It look like some issue ?
External Lookup Relationship could now be setup between external objects and Salesforce object.
External Object - They are same as custom objects but used to map to data located outside Salesforce.
External object take data from External source and External source obviously has its own DB. 
To create external object : From Setup, click Develop | External Objects.
To create external Data source : Develop | External data source
 
I got to know that , Salesforce has recently introduced the Platform Developer 1 certification (DEV450) to replace the Developer (DEV401) certification. All practitioners, with the DEV401 certification, must complete the DEV450 exam during 2016 to retain a Salesforce developer certification.

Is this true as i dnt not got any email from salesforce / webassessvor that if you will not give the DEV450 exam then your DEV401 certifcate will expire ?
 
Hi friends,

I'm an experienced admin but still very new to development. 

I'm trying to push some code that will mandate that a Contact Role be select before an Opportunity can be edited (this is necessary for an integration I'm working on with Hubspot). However, I'm running into the below error in my test case and can't figure out what I'm doing wrong - I've read about this on other forums, but selecting a price book is not like creating an object like an oppty or product in my eyes, so not sure how this applies:
"System.QueryException: List has no rows for assignment to SObject 
Stack Trace: Class.NumberofContactRoles_Test.TestCase1: line 26, column 1" (this is the PriceBook2 line below)

Could someone help me tweak the test case to avoid this error? Thank you sincerely for your help!

@isTest
public class NumberofContactRoles_Test{

    public static testmethod void TestCase1()
    {
    
    Contact ConTest = new Contact();
    ConTest.FirstName = 'TEstCon';
    ConTest.LastName = 'LastName';
    
    insert ConTest;
    System.assertNotEquals(null,ConTest.Id);
    
    Opportunity Opp1 = new Opportunity();
    
    Opp1.Name = 'TestOpp';
    Opp1.StageName = 'Prospect';
    Opp1.CloseDate = System.today()+10;
    
    insert Opp1;
    System.assertNotEquals(null,Opp1.Id);

    Product2 pd = new Product2(Name='Additional Processor Routing2',isActive=true, Family='PR', ProductCode='Payments & Security');
    insert pd;

    PriceBook2 pb2Standard = [select Id from Pricebook2 where isStandard=true limit 1];
    Id standardPriceBookId = pb2Standard.Id;

    PricebookEntry pbe = new PricebookEntry(Pricebook2Id=standardPriceBookId, Product2Id=pd.Id, UnitPrice=99, isActive=true);
    insert pbe;
    
    OpportunityLineItem Oli1 = new OpportunityLineItem();
    Oli1.OpportunityId = opp1.Id;
    Oli1.PricebookEntryId = [select Id from PricebookEntry where isactive=true AND product2.Name='Additional Processor Routing' and Pricebook2.Isstandard=True limit 1][0].id;
    Oli1.UnitPrice = 50;
    Oli1.Quantity=10;
    insert Oli1;
    
    OpportunityContactRole oppRole = new OpportunityContactRole();
    oppRole.OpportunityId = Opp1.Id;
    oppRole.IsPrimary = True;
    oppRole.ContactId = ConTest.Id;
    
    insert oppRole;
    System.assertNotEquals(null,OppRole.Id);
    
    Opp1.Name = 'TestOpp2';
    update Opp1;
    }
}
I have created a VF Page to replicate a form that we use, with an extension to when the command button is pressed on the VF page will attach the form to the record the button to pull up the VF page was caled from. 

I am now trying to test my test class and I am getting the following error message upon testing.  "Methods defined as TestMethod do not support getContent call"

Can anyone help re-write or give suggestions on how to get this test class to test out the controller extension? 

Appreciate any help!

Extension Code:
public class ArmorIncMDNAExtension {

    private final Contract__c contract;
    
    private ApexPages.StandardController standardController;
    
    public ArmorIncMDNAExtension(ApexPages.StandardController standardController) {
        this.Contract = (Contract__c)standardController.getRecord();
    }
    
    public pagereference GeneratePDF(){
pagereference Pg = Page.ArmorIncMDNA;
Blob pdf1 = pg.getcontentAsPdf();
Attachment d = new Attachment();
d.ParentId = contract.Id;
d.Body = Pdf1;
d.Name = contract.Account__r.Name + ' Armor Defense Inc. Mutual NDA.pdf';
d.ContentType = 'application/pdf';
insert d;
return null;
}
    
}

Test class Code:
@isTest
public class ArmorContractExtTest {

    
    
    static testMethod void tm1 () {

		Date myDate = Date.newInstance(2017, 8, 17);
        
        Contract__c c = new Contract__c();
        	c.Account__c = '001S000000rwY8H';
        c.Auto_Renew__c = 'No';
        c.Contract_Term_In_Months__c = 12;
        c.Effective_Date__c = myDate;
        c.Renewal_Period_Term_In_Months__c = 12;
        
        insert c;
         
        ArmorIncMDNAExtension ae = new ArmorIncMDNAExtension(new ApexPages.StandardController(c));
        ae.GeneratePDF();

    }
    
    
}

public class StringArrayTest {
    public static List<String> generateStringArray(){
        Integer iteration = 5;
        List<String> testList = new List<String>{};
            for(Integer i =0; i < iteration; i++){
                testList.add('Test'+ ' ' + i);
                system.debug(testList.get(i));}
  
        Return testList;
    }
}
Hi there, I am very new to Apex coding, and I feel a bit out of my league here, tbh.  I was hoping someone might be able to help me create a Test Class for a Trigger I've created...

I created a trigger on tasks that updates the record type if the task subject contains "Statement Reminder" or "Collection Letter".  Unfortunately, I cannot just use a SF workflow or process to do this because this sort of task is created when a user sends an email out which I guess is a "soft" process that does not activate workflows.  I've copied the code for my trigger below, and it seems to work, but I'm having trouble creating the test class for it.  I'd really appreciate anyone's help!

trigger CollectionTaskRecordType on Task (before insert, before update) {
    for(task t:Trigger.new){
        if(t.Type == 'Email' && t.Subject.contains('Statement Reminder') || t.Type== 'Email' && t.Subject.contains('Collection Letter')){
            (t.RecordTypeId = '01236000000yN92AAE');
        }
    }
}
I seem to be getting a "Server not found" error when trying to go to "workbench.developerforce.com/". Is anyone else getting this?

Thanks,
Hello, 

I am trying to write a test class for a VF controller, and I am getting an error saying the variable does not exist even though it does!  Why would this be happening? 

Here is my controller: 
 
public class DailySalesReportController{ 

        public List<Opportunity> listOfCefOpToday {get;set;}
        public List<Opportunity> listOfLoganOpToday {get;set;}
        public List<Lead> listOfCefLdToday {get;set;}
        public List<Lead> listOfLoganLdToday {get;set;}
        public List<Sales_Meetings__c> listOfCefSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganSkedToday {get;set;}
        public List<Sales_Meetings__c> listOfCefOcToday {get;set;}
        public List<Sales_Meetings__c> listOfLoganOcToday {get;set;}
        public Opportunity CefOpToday {get;set;}
        public Opportunity LoganOpToday {get;set;}
        public Lead CefLdToday {get;set;}
        public Lead LoganLdToday {get;set;}
        public Sales_Meetings__c CefSkedToday {get;set;}
        public Sales_Meetings__c LoganSkedToday {get;set;}
        public Sales_Meetings__c CefOcToday {get;set;}
        public Sales_Meetings__c LoganOcToday {get;set;}
    
    public DailySalesReportController(){
        listOfCefOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOpToday = [Select id, name from Opportunity WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganLdToday = [Select id, name from Lead WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganSkedToday = [Select id, name from Sales_Meetings__c WHERE Created_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        listOfCefOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Jeff Cefalu'];
        listOfLoganOcToday = [Select id, name from Sales_Meetings__c WHERE Occurred_Today__c = TRUE AND Owner_Name__c = 'Logan Connolly'];
        
        
}
}

And here is my test: 
 
@isTest(seeAllData = true)
public class DailySalesReportControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your Opportunity record with required field
        //Opportunity b = new Opportunity(Created_Today__c = TRUE);
        //insert b;
        test.startTest();
           DailySalesReportControllerTest ub = new DailySalesReportControllerTest();
           
           if(ub.listOfCefOpToday!=null && !ub.listOfCefOpToday.isEmpty())
           Opportunity cefOpportunity = ub.listOfCefOpToday.get(0);
           
           if(ub.CefOpToday !=null)
            String CefOpTodayId = ub.CefOpToday.Id;
           
        test.stopTest();
    }   
}

I keep getting this error: 
 
Error: Compile Error: Variable does not exist: listofcefoptoday at line 12 column 41

Can anyone help?  I'm really stuck here 
Hi doing the challengue for this module (completed successfully the previous challengue) I cannot complete the challengue even though all fields are correct.
 Error Received

Here is also de verification of the field label with the requiered fields.
User-added image
 
Hi,

This is my first post on SF dev forum, so be gentle :)

I'm trying to create a workflow rule to e-mail X users when the Billing Address on an Account is changed. I currently have the below rule set up but I can't get it to fire. Does anyone have any ideas to make this work/more elegant!
AND( 
OR( 
ISCHANGED(BillingCity), 
ISCHANGED(BillingStreet), 
ISCHANGED(BillingState), 
ISCHANGED(BillingPostalCode)), 
NOT(ISBLANK( PRIORVALUE(BillingCity))), 
NOT(ISBLANK( PRIORVALUE(BillingStreet))), 
NOT(ISBLANK( PRIORVALUE(BillingState))), 
NOT(ISBLANK( PRIORVALUE(BillingPostalCode))), 
NOT(ISNEW()) 
)

Thanks in advance,
Dan
As we all know for production deployment , Test classes will be automatically running , right !!! . We have issue with that . Half of our test classes are failing because of access issues .

Items to note :
  • 1)in Our test classes it is not using any database data .ie SeeAllData =false
  • 2)First deployment to Production . No recordtypes available
  • 3) we are pushing admin profile in the package which have access to all the records types present .
Issue: Test class is using below statement for creating dummy record with specific record type Schema.SObjectType.Contact.getRecordTypeInfosByName().get('XXXXX').getRecordTypeId();

Actual Issue : As our production doesnt have any recordtype test class is failing saying it unable to find the record type .

Now million dollar question : How we can over come this issue . it is really blocking our production deployment
Hello, 
I am getting this error message in my Conference app when I try to assign a Speaker to a Session, I get this error message. Can you please explain why I am getting this error? I am also pasting the code for the Trigger. Thanks! 

User-added image
User-added image
I am trying to complete the "Visualize Your Business Processes and Salesforce Data" trail but it is telling error.

Challenge Not yet complete... here's what's wrong:
The 'Property Listings' report does not appear to be using a scatter chart.

I followed all the steps still i am not able to complete it.
Please help
Hi All,

I was able to get 75% coverage for my trigger by writing the test class below, however, the code coverage for the trigger helper class is 0, what am I doing wrong?
Here is my trigger:
trigger sessy on session__c (before insert, after insert, after update, before update, before delete) {
    if(recursive.runonce()){
       
        sess  handler = new sess();       
       
       
if(trigger.isbefore && trigger.isupdate){
     sess.onbeforeupdate(trigger.old, trigger.new,trigger.oldmap, trigger.newmap) ; 
         }   
   
   
}
}
here is my helper class:

public class sess {
    public static void onbeforeupdate(list<session__c> oldlist,list<session__c> newlist,map<ID, session__c> oldmap, map<ID, session__c> newmap){
       
    for (AggregateResult ar : [Select Count(ID) numRecs, Alex__c acctid From event__c Where Alex__c In:Trigger.New Group By Alex__c]){ Id acctId = (Id) ar.get('acctId');
    session__c acct = (session__c)Trigger.newMap.get(acctId);
    acct.mike__c = (Decimal) ar.get('numRecs');
}
          
   
    }
   
  }
and here is my tes class for the trigger -HELP PLEASE, why is the helper class gettig 0 coverage?

@isTest
public class sesstest{
static testmethod void     onbeforeupdatetest(){
 Session__c SEPT = new session__c () ;
 
 SEPT.name = 'hippy';
 SEPT.desc__c = 'rte';
 
 
 Insert SEPT;
 
 
 event__c justy = new event__c () ;
 
 justy.name = 'hoppy';
 justy.alex__c = sept.id;
 
 
 
 insert justy;
 
 SEPT.desc__c = 'rtfff';
Test.Starttest();
 Update SEPT;
sess sc = new sess();
 
Test.StopTest();
SEPT = [select ID, Mike__c from session__c where id = :sept.id];
aggregateresult jkl = [select count(ID) ctt, Alex__c tyt from event__c where Alex__c =:sept.id group by Alex__c];
System.assertequals(SEPT.MIKE__C,null);
}}

 
Hello everyone! i am trying to send a text to my leads with twilio with a trigger event once they are created. I am new to salesforce so most of this is a whirlwind to me. If you could fix my code and then explain it that would be best.

Thanks

Apex Class
 
public class Send_SMS_ControllerLead {
    public String smsBody {get; set;}
    public boolean hasNumber {get; set;}
    public final String  fromNumber = '+1xxxxxxxxx';// get it from twilio
      //after login click Phone Numbers tab in left sidebar

    public string dialCode = '+1'; // Add your dial Code of your country.
    public Send_SMS_ControllerLead(ApexPages.StandardController controller) {
       hasNumber = true;
    }
    public static void Send()
    {
        String account = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // Account SID on home tab
        String token   =   'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'';//AUTH Token on home tab
        TwilioRestClient client = new TwilioRestClient(account, token);

        Id leadId = ApexPages.currentPage().getParameters().get('id');

        String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        Lead a = [SELECT Phone FROM Lead WHERE Id = :leadId];

        if(a.Phone != null)
        {
            String phoneNumber = a.Phone;
            if(!phoneNumber.Contains('+1'))
            phoneNumber = '+1'+phoneNumber;// If by default dialCode is not
             //on Phone number we will ad it.
            System.debug('phoneNumber'+phoneNumber);
             Map<String,String> params = new Map<String,String> {
            'To'   => phoneNumber,
            'From' => '+1xxxxxxxxxx',
            'Body' => 'Thanks for applying with Fundwise. An email was sent to you for the next step that will expedite the process. An agent will contact you shortly.'
             };
             TwilioSMS sms = client.getAccount().getSMSMessages().create(params);
             SMS_Lead__c sentSMS = new SMS_Lead__c(From__c = '+1xxxxxxxxxxx',To__c = phoneNumber, Body__c = 'Thanks for applying with Fundwise. An email was sent to you for the next step that will expedite the process. An agent will contact you shortly.');
             insert sentSMS;

        }
        
    }
     
}

and my trigger

Apex Trigger
 
trigger SMS_To_New on Lead (after insert, after update) {
    
    Send_SMS_ControllerLead.Send();
}



Let me know

Thanks!​
When doing the challenge for the Automate Basic Business Processes with Process Builder, I keep getting the following error:
Challenge Not yet complete... here's what's wrong:There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Account number must be 8 characters long.: []

I moved on to the next challenge in Collect Information from Users and then Operate on It with Visual Workflow and I am receiving the following error message: 
Error element Create_Account (FlowRecordCreate).
This error occurred when the flow tried to create records: FIELD_CUSTOM_VALIDATION_EXCEPTION: Account number must be 8 characters long.. For details, see API Exceptions.

I am thinking there is something wrong with the account number, but I don't know how to fix it.  Can anyone help?
Hello, 

I have a controller that is showing 0% code coverage, but I'm not sure why my test class isn't covering anything.  Can anyone help? 

Here is my controller: 
 
public class R2MBizBookController{

    public List<Buyer__c> listOfDeck {get; set;}
    public List<Buyer__c> listOfNewThirty {get; set;}
    public List<Buyer__c> listOfNewTW {get; set;}
    public List<Buyer__c> listOfLegacy {get; set;}
    public List<Buyer__c> listOfTQ {get; set;}
    public List<Buyer__c> listOfAQ {get; set;}
    public List<Buyer__c> listOfBQ {get; set;}
    public List<Buyer__c> listOfCQ {get; set;}
    public List<Buyer__c> listOfDQ {get; set;}
    public List<Buyer__c> listOfEQ {get; set;}
    public Buyer__c Live {get; set;}
    public Buyer__c NewTW {get; set;}
    public Buyer__c Viability {get; set;}
    public Buyer__c LaunchPad {get; set;}
    public Buyer__c TQ {get; set;}
    public Buyer__c AQ {get; set;}
    public Buyer__c BQ {get; set;}
    public Buyer__c CQ {get; set;}
    public Buyer__c DQ {get; set;}
    public Buyer__c EQ {get; set;}
   
public R2MBizBookController() {
    listofDeck = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Commitment_c__c from Buyer__c WHERE Pipeline_Status__c = 'OnDeck' ORDER BY Name ASC];
    listofNewThirty = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'New 30' ORDER BY Sales_Origination_Date__c DESC];
    listofNewTW = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE  New_Live__c = TRUE  ORDER BY Sales_Origination_Date__c DESC];
    listofLegacy = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'Legacy' ORDER BY  Sales_Origination_Date__c DESC];
    listofTQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE TQ_Pipeline__c = TRUE ORDER BY  Sales_Origination_Date__c DESC];
    listofAQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'AQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofBQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'BQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofCQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'CQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofDQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'DQ' ORDER BY  Sales_Origination_Date__c DESC];
    listofEQ = [Select id, name, Sales_Lead_Source__c, Routing_Status__c, Client_Status__c, Total_Re_Orders__c, Sales_Quarter__c, Funds_Collected_All_Time__c, Sales_LN__c, Sales_Origination_Date__c from Buyer__c WHERE Pipeline_Status__c = 'EQ' ORDER BY  Sales_Origination_Date__c DESC];
   
and here is my test: 

}
}
and here is my test? 
 
@isTest(seeAllData = false)
public class R2MBizBookControllerTest{
    // Unit test Method
    static testmethod void UnitTest() {
        //Create your buyer record with required field
        //Buyer__c b = new Buyer__c(Pipeline_Status__c = 'Legacy');
        //insert b;
        test.startTest();
           R2MBizBookController ub = new R2MBizBookController();
        test.stopTest();
    }   
}

would anyone be willing to help me beef this up?

it would mean the world to me. 

thank you in advance!!!!!!

John 
 
Greetings all,
I'm working on a test class and can't figure out why when I run the test I am not getting inside the for loop.  (I assume the test record I'm creating doesn't meet the criteria but can't figure out why).  Could someone kindly help me troubleshoot?  Thanks in advance!

Test class:
@istest
public class TestClassforInvoice {
 public static testMethod void testmyInvoices(){
	Account testAccount = new Account (Name = 'MyHousehold');
    Insert testAccount; 
    Contact testContact = new Contact (LastName= 'smith');
    insert testContact;
    AECaseMgmt__Program__c programNew = new AECaseMgmt__Program__c(Name= 'test prg'); 
	insert programNew; 
    AECaseMgmt__Program_Case__c testCase = new 	AECaseMgmt__Program_Case__c 
        (AECaseMgmt__Open_Date__c = System.now().date(), 	
         Program__c = programNew.Id, BypassValidationForProcessBuilder__c = true); 
     testCase.AECaseMgmt__Household__c = testAccount.id; 
    insert testCase;
    Case_Member_Enrollments__c testmember = new 
        Case_Member_Enrollments__c (Name = 'testCM', Case_ID__c = testCase.id, BypassValidationForProcessBuilder__c=true );
    
    testmember.Case_Member__c = testContact.id;
     insert testmember; 
    
     Client_Billing__c clientbill = new Client_Billing__c 
         (Entry_Type__c = 'Billed Expense', Billing_Item__c = 'Court Report', Client_Case__c = testCase.Id);
     
     PageReference pageRef = Page.SingleInvoice;
        Test.setCurrentPage(pageRef);
     ApexPages.StandardController sc = new ApexPages.StandardController(testcase);
		Invoice  controller = new Invoice(sc);
     pageRef = Page.MultipleInvoices;
        Test.setCurrentPage(pageRef);
		controller = new Invoice(sc);

 }
}
The for loop in my controller extension:

            for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c
                                                   where Id IN (SELECT Client_Case__c FROM Client_Billing__c)])  
            {
                caselist.add(New CasewInvoices (record));    
            }


Again, when I run the test, I'm not covering inside the for loop, and since "caselist" is not being populated, I'm not able to cover a large amount of the rest of my code.

And the entire controller:
public class Invoice {
    public ApexPages.StandardController stdCntrlr {get; set;}
    public list <CasewInvoices> caselist {get; set;}
    public list <Client_Billing__c> tempinvoicelist {get; set;}
    public String currentRecordId {get;set;}
    public decimal thirtydayold {get; set;}
    public decimal sixtydayold {get;set;}
    public decimal ninetydayold {get;set;}
    
    public Invoice(ApexPages.StandardController controller) {
        stdCntrlr = controller;
        if (caselist==null){
            caselist = new List <CasewInvoices>();
            }
        
        tempinvoicelist = [Select ID, Client_Case__c, Name, Amount__c, Date__c,Transaction_Description__c, Amount_Credit_Debit__c 
                           from Client_Billing__c Where Include_on_Invoice__c = true ]; 
		currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');      
     	
        String pageName = ApexPages.currentPage().getUrl().substringAfter('apex/');
		system.debug('-----current ID name----'+currentRecordID);

// populate case list; if from single invoice, just get one case; otherwise get all        
        
            for (AECaseMgmt__Program_Case__c  record: [Select ID, AECaseMgmt__Household__r.BillingSTreet, AECaseMgmt__Household__r.BillingCity,
                                                   AECaseMgmt__Household__r.BillingState,AECaseMgmt__Household__r.BillingPostalCode,
                                                   AECaseMgmt__Household__r.npe01__One2OneContact__r.name,
                                                   Program__r.name, Name,Account_Balance__c from  AECaseMgmt__Program_Case__c 
                                                   where Id IN (SELECT Client_Case__c FROM Client_Billing__c)])  
        	{
            	caselist.add(New CasewInvoices (record));	
        	}
        
        
        for (CasewInvoices caseincrement:caselist)
        {
            Decimal thirtydayold = 3;
            for(Integer i = 0; i <tempinvoicelist.size(); i++){
            	if (tempinvoicelist[i].client_case__c ==caseincrement.clientcase.id)
                    {
                        caseincrement.billinglist.add (tempinvoicelist[i]);
                        If (tempinvoicelist[i].Amount_Credit_Debit__c>0)
                        {
                        	If (tempinvoicelist[i].date__c.daysBetween(date.today())> 90)
                        		caseincrement.ninetydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 60)
                        		caseincrement.sixtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        
                            If (tempinvoicelist[i].date__c.daysBetween(date.today())> 30)
                        		caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                        Else 
                        {
                            caseincrement.ninetydayold = caseincrement.ninetydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.sixtydayold = caseincrement.sixtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                            caseincrement.thirtydayold = caseincrement.thirtydayold + tempinvoicelist[i].Amount_Credit_Debit__c;
                        }
                    }
            }
        }
 }

	Public class CasewInvoices
    {
        public List<Client_Billing__c> billingList {get;set;}
        public AECaseMgmt__Program_Case__c Clientcase {get;set;}
        public decimal thirtydayold {get;set;}
        public decimal sixtydayold {get;set;}
        public decimal ninetydayold {get;set;}
        
        public CasewInvoices (AECaseMgmt__Program_Case__c cc)
        {
            Clientcase = cc;
            billingList = new list<Client_Billing__c>();
            thirtydayold = 0;
            sixtydayold = 0;
            ninetydayold = 0;
        }
	}
}
Hi 

i have a below code i am getting the error:
System.NullPointerException: Attempt to de-reference a null object at line 66

global class Match implements Database.Batchable<sObject>{
    
   global Database.QueryLocator start(Database.BatchableContext BC){
       
       String query = 'SELECT Name, Id, test__c, opportunity__c, test1__c FROM pro__c ';
       
       return Database.getQueryLocator(query);
   }

   global void execute(Database.BatchableContext BC, List<pro__c> planProjects){
        Map<String,List<task__c>> taskw = new Map<String,List<task__c>>();
        Map<String,List<milest>> milestW = new Map<String,List<milest>>();
        
           List<String> ppIds = new List<String>();
        for(pro__c pp : planProjects){
            ppIds.add(pp.Id);
        }
       
        List<task__c> Tractas = [SELECT Id,Name,Tracker__r.TrP__r.pro__c,Status__c,
                                                        Comments__c,Completed_Date__c
                                                        FROM  task__c
                                                        WHERE Tracker__r.TrP__r.pro__c in :ppIds];
        
        for(task__c tt : Tractas){
            List<task__c> taskl = new List<task__c>();
            if(taskw.containsKey(tt.Tracker__r.TrP__r.pro__c)){
                
                taskl = taskw.get(tt.Tracker__r.TrP__r.pro__c);    
            }
            taskl.add(tt);
            taskw.put(tt.Tracker__r.TrP__r.pro__c,taskl);
        }
        
        List<milest> milest= [SELECT Id,Name,Status__c,Comments__c,Date__c,pro__c 
                                                    FROM milest
                                                    WHERE pro__c in :ppIds];
                                                    
        for(milest milestone : milest){
            
            List<milest> mileList = new List<milest>();
            
            if(milestW.containsKey(milestone.pro__c)){
                
                mileList = milestW.get(milestone.pro__c);
                
            }
            
            mileList.add(milestone);
            milestW.put(milestone.pro__c,mileList);
            
        }
       
        List<task__c> tasksToUpdate = new List<task__c>();
        LIst<MilestoneMapping__c> mappingRecords = MilestoneMapping__c.getall().values();
        Map<String,String> milestoneMap = new Map<String,String>();
        
        for(MilestoneMapping__c mappingRec : mappingRecords){
            milestoneMap.put(mappingRec.Task_Name__c, mappingRec.Milestone_Name__c);
        }
       
        for(String ppId : taskw.keyset()){
            
            for(task__c tt : taskw.get(ppId)){
                String milestoneMappinName = milestoneMap.get(tt.Name);
                
                
           ---->     for(milest mile :milestW.get(ppId) ){
                    
                    if(mile.Name == milestoneMappinName){
                        tt.Status__c = mile.Status__c;
                        tt.Comments__c = mile.Comments__c;
                        tt.Completed_Date__c = mile.Date__c;
                        tasksToUpdate.add(tt);
                    }
                }

            }
        }    
       
        if(!tasksToUpdate.isEmpty()){
           update tasksToUpdate;
        }
    }

can anyone please help me to get rid of this error
I was working on the Customize Your Login Process with My Domain module and I accidentally changed my domain of my Hands-On Org. Is it possible to change it back to what it was? I get an error message now when I try to launch my hands-on org. L

My former Hands On Org. URL is as follows: curious-badger-397879-dev-ed.my.salesforce.com

The domain I changed it to is: mylightsaber.dom-dev-ed.my.salesforce.com
 
NOT (ISPICKVAL( Transfer_ID__r.Transfer_Type__c , 'Store to WHS') AND (Shipping_Quantity__c > Serial_No__r.Quantity_available__c ))

I am getting ) missing in thie validation rule, Can someone help?

System.QueryException: List has more than 1 row for assignment to SObject
Class.AccountSearchUI.<init>: line 13, column 1

My VF Page

<apex:page standardController="Account" extensions="AccountSearchUI">
<head>
<title>Account Search UI</title>
<style type="text/css"> </style>
</head>

<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
        <td bgcolor="#FFFFFF"></td>
        <td bgcolor="#FFFFFF"></td>
        <td bgcolor="#FFFFFF"></td>
      </tr>
    <tr>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="5" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
    <td bgcolor="#FFFFFF" valign="top">
        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" class="tablemain">
            <tr><td height="1"></td></tr>
            <tr><td height="50" class="headingmain">&nbsp;Account Search UI</td></tr>
            <tr>
                <td align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="1" class="tablemain">
                    <tr>
                      <td width="10%" height="23" class="headingsub1">Group Org Acc</td>
                      <td width="10%" height="23" class="headingsub1">Vertical</td>
                      <td width="10%" height="23" class="headingsub1">Account Name</td>
                      <td width="10%" height="23" class="headingsub1">Type</td>
                      <td width="10%" height="23" class="headingsub1">Owner Last Name</td>
                      <td width="10%" height="23" class="headingsub1">Client Rank</td>
                      <td width="10%" height="23" class="headingsub1">Account Plan</td>
                      <td width="10%" height="23" class="headingsub1">Last Modified</td>
                      <td width="10%" height="23" class="headingsub1">View Latest PDF</td>
                      <td width="10%" height="23" class="headingsub1">PDF Upload Date</td>
                    </tr>
                    <apex:repeat value="{!accPList}" var="cp">
                    <tr>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Group_Org__c}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Vertical__c}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Name}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Type}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Client_Rank__c}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Group_Org__c}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Vertical__c}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Name}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Type}"/></td>
                        <td height="23" class="headingsub1"><apex:outputField value="{!cp.Client_Rank__c}"/></td>
                    </tr>
                    </apex:repeat>
          </table>
        </td>
        
      </tr>
    </table></td>
    <td bgcolor="#FFFFFF" valign="top"></td>
    <td bgcolor="#FFFFFF" valign="top"></td>
  </tr>
  
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>

</table>

</body>

</apex:page>

APEX Class
public with sharing class AccountSearchUI{    

    public ApexPages.StandardController stdController {get; set;}
    public Account acc {get; set;}
    public Account accPList {get; set;}
    
    public String accountName ='';
    public AccountSearchUI(ApexPages.StandardController stdController){
    this.stdController = stdController;

 accPList = [select Group_Org__c, Vertical__c, Name, Type, Client_Rank__c from Account where Top_25_Client__c = true and Client_Rank__c < 26 order by Client_Rank__c ASC limit 5];
    }
}
Can anyone help with the issue.
 
This is my code
=============
global class BatchApex implements Database.Batchable<sobject>{
    global Database.QueryLocator start(Database.BatchableContext bc){
        return Database.getQueryLocator('select id from Opportunity');
        
    }
    global void execute(Database.BatchableContext bc,List<Opportunity>scope){
        for(Opportunity o:scope){
            o.Name='sandhya';
        }
    update scope;
}
    global void finish(Database.BatchableContext bc){
            
   Messaging.SingleEmailMessage[] mail=new Messaging.SingleEmailMessage();
        String[] toAddresses=new String[] {'forcesfdcloud@gmail.com'};
            mail.setToAddresses(toAddresses);
        mail.setSubject('sending mail ');
        mail.setPlainTextBody('process completed success fully');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
      
    }
    }
I want to update my opportunities. After updating the opportunities i want to send a mail to the above mentioned address, but it shows error like" Illegal assignment from Messaging.SingleEmailMessage to List<Messaging.SingleEmailMessage>" can any one tell me how to solve this issue.
trigger CheckValidationonCaseClose on Case (after update) {     
for(Case e:Trigger.New){          
Case d=Trigger.oldMap.get(e.Id);         
if(d.Signature_Required__c==true && d.Customer_Signature_Status__c!='Completed' && e.IsClosed==true)
{  
e.adderror('Cannot Close Case');
}

its urgent
}  
Hi,

I have a rquirement to format a time which is given in HH:MM format (24-hour clock) into the user's locale. I assumed that there would be a fromat() method as the DateTime class does, but it does not exist.

Any ideas how I can do this?

Thanks
I have a Salesforce App which passed security review for the first time in the last year. This App also includes integration with external web application, due to this I also submitted a BURP scan report of the external web application. I am not sure about how Salesforce conducts periodic security review and have some queries.

As you may know, Salesforce provides periodic, point-in-time review at an interval determined by salesforce.com (typically anywhere between 6 months to 2 years).

• As per Salesforce documentation for already passed Apps, around the expiry date, Salesforce contacts partners to arrange another review. Can you guide me on how much time Salesforce gives us to prepare for Security Review?

• BURP scan and fixing the issues reported by it can take time. If I could not submit a clean BURP scan report within the time frame provided by Salesforce, Does Salesforce remove package from AppExchange?

• Salesforce charges for Security Review process for paid Apps, as one-time upfront fee, and a small subsequent annual fee. Can you guide me on how much subsequent annual fee Salesforce charges to partners? Salesforce also charges annual listing fee of $150 USD. Is that correct?

Kindly help me with this. Thanks in advance.
Hi All,

I want to disable the global search for particular users,i have disabled the chatter in chatte section,please give me suggestion how to disable the global search.
see the below screen shot where i have disabled
User-added image

see the below screen shot for what i want to disable 

User-added image

Thanks,
Surya
I'm stuck on only one unit for this module; the controlling access to fields unit:

"Two team members need to view and update Accounts, but only one should be able to see and edit the Rating field. Create one profile and one permission set with field level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'."

"Challenge Not yet complete... here's what's wrong:
The 'Basic Account User' profile did not have the appropriate object and field-level security for the Account object "
  • February 02, 2016
  • Like
  • 1
Hi Jacob,

I have already completed 5 badges, but still no email for obtaining the Cloak of Adventure sweatshirt. Does it take username or email address for sending emails, as my email address and user name are different.

User-added image
Hi,

I want to send an email alert to task owner if they have any open task which due date is already passed.
I want to send it 1 day after due date and 1 week after due date.
Please suggest how I can achieve it because through workflow it is not achievable.

Regards
Emily
 view state and need a steps how can we reduce view state without help of transient
Hi,

I have executed "Run all test" to get code coverage of all apex classes. Is there way to get all apex classes code coverage with percentage copy to excel sheet. I am able to see all classes with percentage in Developer console. But not able to copy all those. Please provide some suggestion.
We are using Apex Data Loader 19.0 and cliq_process.  Using Apex Data Loader & Cliq_process, we are exporting the data into salesforce custom object. The process was working fine past 2 years and till last week. Last few days we are getting the below error.


2015-08-17 06:12:31,218 INFO  [ExportRevenue] process.ProcessRunner run (ProcessRunner.java:104) - Logging in to: https://www.salesforce.com/services/Soap/u/19.0
2015-08-17 06:12:31,233 INFO  [ExportRevenue] client.PartnerClient login (PartnerClient.java:989) - Beginning Partner Salesforce login ....
2015-08-17 06:12:31,249 INFO  [ExportRevenue] client.PartnerClient login (PartnerClient.java:998) - Salesforce login to https://www.salesforce.com/services/Soap/u/19.0/services/Soap/u/19.0 as user forceuser@<company>.com
2015-08-17 06:12:31,655 INFO  [ExportRevenue] dao.DataAccessObjectFactory getDaoInstance (DataAccessObjectFactory.java:51) - Instantiating data access object: C:\Program Files\salesforce.com\Apex Data Loader 19.0\cliq_process\ExportRevenue\write\ExportRevenue.csv of type: csvWrite
2015-08-17 06:12:31,655 INFO  [ExportRevenue] process.ProcessRunner run (ProcessRunner.java:109) - Checking the data access object connection
2015-08-17 06:12:31,655 INFO  [ExportRevenue] process.ProcessRunner run (ProcessRunner.java:114) - Setting field types
2015-08-17 06:12:31,766 ERROR [ExportRevenue] client.PartnerClient describeSObject (PartnerClient.java:1249) - Error while calling web service operation: describeSObject, error was: Failed to send request to https://ncst.my.salesforce.com/services/Soap/u/19.0/00D400000009okc
com.sforce.ws.ConnectionException: Failed to send request to https://<company>.my.salesforce.com/services/Soap/u/19.0/00D400000009okc
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:113)
    at com.sforce.soap.partner.PartnerConnection.describeSObject(PartnerConnection.java:48)
    at com.salesforce.dataloader.client.PartnerClient.describeSObject(PartnerClient.java:1240)
    at com.salesforce.dataloader.client.PartnerClient.setFieldTypes(PartnerClient.java:1196)
    at com.salesforce.dataloader.controller.Controller.setFieldTypes(Controller.java:127)
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:115)
    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:229)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:847)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:815)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
    at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:97)
    at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:82)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
    ... 6 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
    at sun.security.validator.Validator.validate(Validator.java:203)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:840)
    ... 19 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
    ... 24 more
2015-08-17 06:12:31,766 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:214) - Unable to run process ExportRevenue
java.lang.RuntimeException: com.sforce.ws.ConnectionException: Failed to send request to https://<company>.my.salesforce.com/services/Soap/u/19.0/00D400000009okc
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:139)
    at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:229)
Caused by: com.sforce.ws.ConnectionException: Failed to send request to https://<company>.my.salesforce.com/services/Soap/u/19.0/00D400000009okc
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:113)
    at com.sforce.soap.partner.PartnerConnection.describeSObject(PartnerConnection.java:48)
    at com.salesforce.dataloader.client.PartnerClient.describeSObject(PartnerClient.java:1240)
    at com.salesforce.dataloader.client.PartnerClient.setFieldTypes(PartnerClient.java:1196)
    at com.salesforce.dataloader.controller.Controller.setFieldTypes(Controller.java:127)
    at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:115)
    ... 1 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:847)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:815)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
    at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:97)
    at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:82)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
    ... 6 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
Exact replication steps:
1. Create a connected app
2. Add the callback URL to that connected app as the URL of a VF page. For Eg - 'https://c.eu2.visual.force.com/apex/mypage'.
3. Connect to another salesforce org of the same instance.Énter the login details ie username and password
4. Allow permission to the connected app create on your source org to access info about target org by clicking on Állow Button'
5. Instead of redirecting back to source org it redirects me to the target org and tries to open up the page mentioned in the callback url.
6. This issue is coming when my source and target org are on same instance. It works fine when source and target instances are different.
Hello,
I have some queries on release versioning and listing subsequent versions on AppExchange:
  1. Can I release and maintain 2 versions on AppExchange? In other words, if there a v1.0 that is listed on AppExchange, and we release a new version v1.1 that has passed Security Review and ready to be listed on AppExchange, does it automatically replace the v1.0 that was listed earlier? 
  2. Do the existing customer orgs get any notification of a new released version? If yes, does it automatically contain the install link? If not, what is the most preferred practice?
  3. If I deprecate an earlier version, do the customer orgs using this version get a notification to upgrade? Are they forced to upgrade?
  4. If a patch is created for a particular released version, do I have to manually inform all customer orgs using it? Or do they get automatic notifications of the same and can choose to apply the patch as needed?
Thanks in advance!
Hi,

I want to develop an "Open CTI Adapter", where can I find the documentation(API/Library) for the same?

Regards,
Rohan
Hi ,
  
 I'm trying to parse Account records to JSON string. But I'm getting unnecessary data like attributes(type,url) that is not required in String.

Can any one pls help me in how to parse the string to required format.
List<Account> accnts=[Select Name,Phone From Account];
String s=JSON.serialize(accnts);
The resulting output is in below fromat..
{
  "attributes" : {
    "type" : "Account",
    "url" : "/services/data/v34.0/sobjects/Account/00128000002trGGAAY"
  },
  "Name" : "GenePoint",
  "Phone" : "(650) 867-3450",
  "Id" : "00128000002trGGAAY"
}


My requirement is to generate resulting String as below JSON string format.
 
{
  "Name" : "GenePoint",
  "Phone" : "(650) 867-3450",
  "Id" : "00128000002trGGAAY"
}

So that I can minimize the data to to be sent the the client system.

Any help is really appreciated. Thanks in advance.

Regards,
Naveen.
I need to download Contacts Near By component for the trailhead - field sales app project but I am not able to find it on appexchange. Any idea where can I get it from?