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


  • Chatter
    Feed
  • 1000
    Best Answers
  • 1
    Likes Received
  • 30
    Likes Given
  • 3
    Questions
  • 4745
    Replies
Line no 14 I am getting this error. "Type cannot be constructed: String" Please help me on this.
  1.    public String type_Z {get;set;} 
  2.     public List<String> authcookies {get;set;} 
  3.  
  4.     public JsonStringsss(JSONParser parser) {
  5.         while (parser.nextToken() != JSONToken.END_OBJECT) {
  6.             if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
  7.                 String text = parser.getText();
  8.                 if (parser.nextToken() != JSONToken.VALUE_NULL) {
  9.                     if (text == 'type') {
  10.                         type_Z = parser.getText();
  11.                     } else if (text == 'auth-cookies') {
  12.                         authcookies = new List<String>();
  13.                         while (parser.nextToken() != JSONToken.END_ARRAY) {
  14.                             authcookies.add(new String(parser));
  15.                         }
  16.                     } else {
  17.                         System.debug(LoggingLevel.WARN, 'Root consuming unrecognized property: '+text);
  18.                         consumeObject(parser);
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
Here is my code Any help is appreciated
trigger Testopp on Opportunity (after insert, after update) {
    for(Opportunity opp:Trigger.new){
        if(opp.StageName=='Closed Won'){
            OpportunityLineItem op=new OpportunityLineItem();
            op.Demo5__Ready_to_close__c = true;
        }
    }
        


}
I have a simple trigger that updates a field.  My test class is not passing, however gives 80% coverage on the trigger.  

Here is the trigger:

trigger Update_MQL on Lead (before insert, before update) {
for (Lead myLead : Trigger.new)
{
    if (myLead.MQL_Date__c == null && (myLead.Status =='MQL (Marketing Qualified Lead)' || myLead.Status == 'SAL (Sales Accepted Lead)'))
    {myLead.MQL_Date__c = system.today();
    }else { myLead.MQL_Date__c = myLead.MQL_Date__c;
    }
     }
     
}


Here is the test class:

@isTest 
public class TestUpdate_MQL {
    static testMethod void insertNewLead() {
    
    Lead newLead = new Lead();
    
    newLead.FirstName = 'Mike';
    newLead.LastName = 'DeMille';
    newLead.Status = 'MQL (Marketing Qualified lead)';
    newLead.LeadSource = 'Advertisment';
    
    insert newLead;
    
 
       System.assertEquals(system.today(), newLead.MQL_Date__c);
    
    }
    
    }


What needs to be fixed?
Hi

I am having an issue with this exercise. Even though my locale is set to English (US) my currency is stil showing GBP so I cannot finish the task

Is there any other way I can change this?

Many thanks
Zara
Trying to bulk up this method and struggling with the map concept. The Agreement__c has a related list called Facilities_Covered__c, It also has a related Modification__c and when it is created I am building a junction object between it and the Facilities (account). How can i create the group of related items?
 
public void setrelatedFC() {
			List<Modifications_Facilities_Covered__c> newFC = new List<Modifications_Facilities_Covered__c>();

			for (Modification__c newmods : newModifications.values())
				{

				Modifications_Facilities_Covered__c fc = new Modifications_Facilities_Covered__c();	

					
					list<Facilities_Covered__c> fac = [select Facility__c from Facilities_Covered__c where Agreement__c = :newmods.Agreement__c];

					for(Facilities_Covered__c f : fac )
					{

					fc.Modification__c  = newmods.id ;
					fc.Facility__c    =  f.Facility__c;

					newFC.add(fc);
					}
				}
				insert newFC;
		}

 
//BlockContentLinkTrigger
trigger BlockContentLinkTrigger on ContentDocumentLink (before insert) {  
    for(ContentDocumentLink  contDocL : Trigger.new) {
            contDocL.addError('Pièce joint bloquée depuis objet ContentDocumentLink');
   }  
}

 
This is a simple field update trigger and I need help getting it bulkified.  I appreciate any help.

trigger Update_MQL on Lead (before insert, before update) {
for (Lead myLead : Trigger.new)
{
    if (myLead.MQL_Date__c == null && (myLead.Status =='MQL (Marketing Qualified Lead)' || myLead.Status == 'SAL (Sales Accepted Lead)'))
    {myLead.MQL_Date__c = system.today();
    }else { myLead.MQL_Date__c = myLead.MQL_Date__c;
    }
     }
     
}
Insertion throwing error working fine but updation is not working can anyone give me a solution...
trigger duplicatePhoneOnCandidate on Candidate__c (before insert) 
{
    Map<String, Candidate__c> candidateMap = new Map<String, Candidate__c>();
    for(Candidate__c candidates: System.Trigger.new)
    {
    // Make sure we don't treat an Phone address that isn't changing during an update as a duplicate. 
        if(candidates.Phone__c != null && (System.Trigger.isInsert && System.Trigger.isUpdate || (candidates.Phone__c != System.Trigger.oldMap.get(candidates.Id).Phone__c)))
        //if(candidates.Phone__c != null && System.Trigger.isInsert)
        {
         // Make sure another new Candidate isn't also a duplicate 
        if(candidateMap.containsKey(candidates.Phone__c))
            {
            candidates.Phone__c.addError('Phone Already exists');
            }
            else
            {
        candidateMap.put(candidates.Phone__c, candidates) ;   
            }
        }

    }  // Using a single database query, find all the Candidate in
        // the database that have the same Phone address as any
        // of the Candidate being inserted or updated.
    for (Candidate__c can : [SELECT Phone__c FROM Candidate__c
                      WHERE Phone__c IN :candidateMap.KeySet()]) {
        Candidate__c newCan = candidateMap.get(can.Phone__c);
        newCan.Phone__c.addError('Candidate record have already this pone number.');
    }
}
Thank you for any insight and for spending a few minutes to look over the following code.  I am fairly new to apex and I am having issues getting this trigger to run in a batch scenario.  I am constantly getting SOQL 101 Govenor Limit error and can not figure out how to properly "Bulkify" this code. 

Hoping someone can help out with some advice....Thanks in advance!!!!

The error is showing as hittong the limit from line 27...


Trigger Code:
1. trigger InstallProdDuplicatePreventer on AVISPL_Client_Product__c (before insert, before update) {
2.
3.    //They can have the same name provided they have different record types
4.
5.    Map<String, AVISPL_Client_Product__c> IPMap = new Map<String, AVISPL_Client_Product__c>();
6.    Set<String> ipNameAndRecordTypeIdConcatSet = new Set<String>();
7.    for (AVISPL_Client_Product__c IP : System.Trigger.new) {
8.        If(IP.Virtual_Product__c == false){
9.        String ipNameAndRecordTypeId = IP.name + '' + IP.recordTypeId;
10.        
11.        // Make sure we don't treat a name that isn't changing during an update as a duplicate.  
12.        if ((IP.Name != null) &&
13.                (System.Trigger.isInsert ||
14.                    IP.Name != System.Trigger.oldMap.get(IP.Id).Name)) {
15.        
16.            // Make sure another new Installed Product isn't also a duplicate  
17.            if (IPMap.containsKey(IP.Name) && ipNameAndRecordTypeIdConcatSet.contains(ipNameAndRecordTypeId)) {
18.                IP.Name.addError('Another new Installed Product has the same Name for this Record Type.');
19.            } else {
20.                IPMap.put(IP.Name, IP);
21.                ipNameAndRecordTypeIdConcatSet.add(ipNameAndRecordTypeId);
22.            }
23.        }
24.    }
25.    
26.    // Using a single database query, find all the Installed Products in the database that have the same name as any of the Installed Products being inserted or updated.  
27.    for (AVISPL_Client_Product__c Ip2 : [SELECT Name, RecordTypeId FROM AVISPL_Client_Product__c WHERE Name IN :IPMap.KeySet()]) {
28.        AVISPL_Client_Product__c newIP = IPMap.get(IP2.Name);
29.        String ipNameAndRecordTypeId = Ip2.name + '' + Ip2.recordTypeId;
30.        
31.        if(ipNameAndRecordTypeIdConcatSet.contains(ipNameAndRecordTypeId)) {
32.            newIP.Name.addError('A Installed Product with this name already exists for this Record Type.');
33.        }
34.        }
35.    }
36.}
Need help?
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: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AddRelatedRecord: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_percent__c]: [Discount_percent__c] Trigger.AddRelatedRecord: line 14, column 1: []


trigger AccountAddressTrigger on Account (before insert,before update) {
    for(Account a :Trigger.new)
    {
        if(a.Match_Billing_Address__c == true)
        {
            a.ShippingPostalcode = a.BillingPostalcode;
        }
    }
}
I am trying to solve this chalange:
Create an approval process that validates when a Prospect Account becomes a Customer.

I think I have done every steps correctly but still getting this 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, Value should be number: [SLASerialNumber__c]

I have tried this in 3 different developer page but still getting the same error
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger eventCreateJobOutcome caused an unexpected exception, contact your administrator: eventCreateJobOutcome: execution of AfterInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.eventCreateJobOutcome: line 2, column 1
public with sharing class LaunchTinderboxController {

    Id oppid = System.currentPageReference().getParameters().get('id');
    string buttonid = System.currentPageReference().getParameters().get('bid');
    
    public Opportunity opp = new Opportunity();
    public Opportunity getOpp(){
        opp = [SELECT Id, Proposal_Template__c, Tbox_template__c, Contract__c, Pricing_Option__c, Include_Additional_Pricing_Option__c, Additional_Pricing_Option__c from Opportunity where Id = :oppid];
        return opp;
    }
    
    public PageReference gotoTinderbox(){
        getOpp();
        if (buttonid == 'proposal'){
            opp.Tbox_template__c = opp.Proposal_Template__c;
            update opp;
        }
        if (buttonid == 'contract'){
            opp.Tbox_template__c = opp.Contract__c;
            update opp;
        }
        if (buttonid == 'baa'){
            opp.Tbox_template__c = 'BAA';
            update opp;
        }
    PageReference callPage = new PageReference('/apex/tinderbox__create_proposal_opp?Id='+oppid);
    return callPage;    
    }
}
@isTest
private class TestCheckJitterbitExtract {

    static testMethod void myUnitTest() {
       Test.startTest();

    Batchaccountcountfieldschedule sh1 = new Batchaccountcountfieldschedule();

    String sch = '0 0 2 * * ?';

    system.schedule('Test Territory Check', sch, sh1);

    Test.stopTest();
       
        
    }
}

for 

global class CheckJitterbitExtract implements Schedulable{
    global void execute(SchedulableContext SC) {
        boolean jobRanOK = false;
        DateTime dt = DateTime.now().addHours(-5);
        for(LoginHistory lh : [Select Status, LoginTime, Application From LoginHistory where LoginType = 'Partner Product' and UserId = '00560000001brWwAAI' and LoginTime > :dt]){
            if(lh.Status == 'Success' && lh.Application.contains('Jitterbit')){
                jobRanOK = true;
            }
        }
        if(!jobRanOK)
            throw new JitterbitException('Please check Jitterbit to investigate a possible issue with ToBe extract as there was no connection made to SF today.');
    }
}


 
trigger Example on Product2 (before insert,before update,after insert,after update) {

        System.debug('Inside Trigger ** -->');

        Product2TriggerHelper helper = new Product2TriggerHelper();
        if(!System.label.SYS_RunAPTS_ProductTrigger.equalsIgnoreCase('NO')){
            if (Trigger.isInsert && Trigger.isAfter) {
                 try{
                    
                    helper.onAfterInsert(Trigger.New);
                 }catch(Exception ex){
                     system.debug('Exception exists while inserting PriceListItem' + ex.getMessage());
                 }
            }
            if (Trigger.isUpdate && Trigger.isAfter) {
                try{

                    helper.onAfterUpdate(Trigger.New);
                 }catch(Exception ex){
                     system.debug('Exception exists while inserting PriceListItem' + ex.getMessage());
                 }
            }
        }
    }

Thanks in advance.
Hello,

Is there any way to deploy new profile created via changeset ?
Hi - I'm not sure why I'm getting the following error when I try to submit my challenge: 

Challenge Not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Below is my code:
public class StringArrayTest {

//public static method called 'generateStringArray'
//return an array (list) of strings.
//each string must have a value in this format: 'Test n' (n=index of the current string in the array)
//The number of returned strings is specified by the integer parameter to the 'generateStringArray'method

    public static list<String> generateStringArray(Integer parameter){
        
        
        
        List<String> listofStrings = new List<String>();
        //listofStrings.add('Test n'); Adding this before the loop didn't give me values for n
        //List<String> listofStrings = new List<String>{'Test n'}; Same issue as above. Defined too early. 
       
     
     
        for(Integer n=0; n<= parameter; n++){
           listofStrings.add('Test '+n);
            
            
           //System.debug('n:'+n); This helped me to find out that I am getting the numbers for n that I want. 
            
            //System.debug('listofStrings: '+listofStrings); This was too early and inside the loop, so I was
            //getting a line in the system debug each time the loop ran. 
            
        }
      System.debug('listOfStrings:' +listofStrings);
               
        return listofStrings;
        
    }
    
    
}

And this is what I've put in Execute Anonymous:
List<String>listofStrings = StringArrayTest.generateStringArray(5);

Hi,

I wanted to remove a user if the user's profile is changed or if I make user inactive. 
Here is the part of code I am working on, which throws me an error:

        EXCEPTION_THROWN [41]|System.ListException: Missing id at index: 0

@future
public static void DeteleFromGroups(Set<Id> userIds){
    Group g=[SELECT Id, DeveloperName from Group Where DeveloperName='Supervisors'];  //Fetching Group 
    List<GroupMember> listGroupMember =new List<GroupMember>();        //Group member instance
    List<User> users=[Select Id, Name, User.Profile.Name, User.IsActive from user Where Id IN :userIds]; //Fetching user
   
    for (User user : users){
        GroupMember gm= new GroupMember(); 
        if((user.Profile.Name != 'Supervisor' && user.IsActive) || (user.Profile.Name == 'Supervisor' && user.IsActive == FALSE)){
                gm.GroupId=g.id;
                gm.UserOrGroupId = user.id;
               	listGroupMember.add(gm);
            }
    }
    
    if(listGroupMember.size() > 0){
        delete listGroupMember;
    	
        //delete listGroupMember[0].UserOrGroupId;
    }
  }

Please help me out in dealing with this.
Thanks!
 
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,

Is it possible to access Field Service Lightning (Managed Package) - Service appointment object from SOQL?
I've tried [SELECT Id, Name FROM FSL__Service_Appointment];
[SELECT Id, Name FROM FSL__ServiceAppointment];
[SELECT Id, Name FROM FSL__Service_Appointment__c];
and plethora of other ways, but i always get: 

"sObject type 'FSL__ServiceAppointment__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names."
Trouble with completing trailhead challenge. Getting the below error even after creating a report
Challenge Not yet complete... here's what's wrong: 
The custom report named 'High Value Opportunities' wasn't found.


 
How to Update the Case status to Closed using trigger When ClosedDate is Today.
can any one help me.
Thanks in advance
 
Line no 14 I am getting this error. "Type cannot be constructed: String" Please help me on this.
  1.    public String type_Z {get;set;} 
  2.     public List<String> authcookies {get;set;} 
  3.  
  4.     public JsonStringsss(JSONParser parser) {
  5.         while (parser.nextToken() != JSONToken.END_OBJECT) {
  6.             if (parser.getCurrentToken() == JSONToken.FIELD_NAME) {
  7.                 String text = parser.getText();
  8.                 if (parser.nextToken() != JSONToken.VALUE_NULL) {
  9.                     if (text == 'type') {
  10.                         type_Z = parser.getText();
  11.                     } else if (text == 'auth-cookies') {
  12.                         authcookies = new List<String>();
  13.                         while (parser.nextToken() != JSONToken.END_ARRAY) {
  14.                             authcookies.add(new String(parser));
  15.                         }
  16.                     } else {
  17.                         System.debug(LoggingLevel.WARN, 'Root consuming unrecognized property: '+text);
  18.                         consumeObject(parser);
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
Successfully imported "Contactsand Accounts", "Opportnities", "Hobbies" but COULD NOT IMPORT "Contact Hobbies".  Mapping is not as evident as other objects. Anybody has any idea?
We are seeing an error in one of our classes where we are exceeding CPU time.  Added some debug statements to the code has determined that a large SOQL statement is to blame.   Any ideas to avoid this?  I was unde the impression that SOQL statements are excluded from the CPU time calculation.

I have included the pertinent section of the log, in case you don't believe me ;)

12:43:48.0 (239206415)|USER_DEBUG|[379]|INFO|mikem4b.Amount of CPU Time: 177
12:43:48.0 (243726579)|SOQL_EXECUTE_BEGIN|[381]|Aggregations:0|SELECT Id,IsDeleted,LineNumber,CurrencyIsoCode,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp,QuoteId,PricebookEntryId,Quantity,UnitPrice,Discount,Description,ServiceDate,Product2Id,SortOrder,ListPrice,Subtotal,TotalPrice,BT_Account_Name__c,BT_Contact__c,BT_Address_Usage__c,BT_Contact_First_Name__c,BT_Contact_Last_Name__c,BT_Sales_Channel__c,BT_Country_of_revenue__c,BT_Oracle_customer__c,BT_Bill_to_account_site_ID__c,BT_Address__c,BT_City__c,BT_State__c,BT_Postal_Code__c,BT_Country__c,ST_Account_Name__c,EU_Account_Name__c,Opportunity_Account__c,ST_Address__c,EU_Address__c,ST_Address_Usage__c,EU_Address_Usage__c,ST_Ship_to_account_site_ID__c,FPX_ListPrice__c,EU_End_User_account_site_ID__c,ST_City__c,EU_City__c,ST_Contact__c,EU_Contact__c,ST_Country__c,EU_Country__c,ST_Country_of_revenue__c,EU_Country_of_revenue__c,ST_Oracle_customer__c,EU_Oracle_customer__c,ST_Postal_Code__c,EU_Postal_Code__c,ST_State__c,EU_State__c,ST_Contact_Role__c,BT_Contact_Role__c,EU_Contact_Role__c,Select_Bill_To_Contact__c,Select_Ship_To_Contact__c,Select_Installed_At_Contact__c,Delivery_Instructions_DI__c,Delivery_Contact__c,Primary_Quote_Flag__c,Quote__c,Revision__c,Quote_Name__c,Status__c,Order__c,Order_Status__c,Price_List__c,Active__c,PO_Received__c,PO_Received_By__c,PO_Received_Date__c,Currency__c,Quote_Expiry_Date__c,Comments__c,Requested_Delivery_Date__c,Oracle_Order__c,Install_At_Country__c,CERTS_Sub_Status__c,Total_Gross_Revenue__c,Cost_Center__c,Sent_To_NetSuite__c,Internal_Comments__c,Last_Export_Date__c,Organization__c,Type__c,Select_Bill_To_Address_Usage__c,Action__c,Mode__c,Config_Complete__c,Ext_Qty__c,Asset_S_N__c,Base_S_N__c,Product_List_Price__c,Std_Buy_price__c,Product_Sub_Category__c,Net_Revenue__c,Cost__c,Marketing_Category__c,Gross_Margin__c,Gross_Margin_Percentage__c,Program_Discount_Value__c,Manual_Discount_Percentage__c,Deferred_Maint_Rev__c,Renewal_MMC__c,Current_Model_Version__c,Configured_Model_Version__c,Post_Program_Price__c,Product_Measure__c,Doc_Config__c,WCA_Amount__c,Line_Discount_Percentage__c,Item_Unit__c,Bundle_ID__c,Bundle_Description__c,Bundle_Modified__c,Bundle_Name__c,Solution_Selector__c,Expert_Mode__c,Base_Asset_Serial__c,Install_At_Address_Id__c,Install_At_Address_Name__c,Ship_To_Address_Id__c,Ship_To_Address_Name__c,Standard_Buy_Price__c,License_Type__c,MPD_Flag__c,MPD_Counter__c,Elapsed_Term__c,Product_Sub_Type__c,MPD_Adjustment__c,NS_Adjustment__c,Product_Term__c,Product_Type__c,Manual_Price_Override__c,Quote_SPT_Level__c,Quote_Upgrade_SPT_Level__c,Oracle_GL_Code__c,Unit_Cost__c,Covered_Product__c,Unit_Price_MMC__c,Unit_Net_MMC__c,NS_Flag__c,Product_Life_Cycle_Status__c,Unit_Product_List_Price__c,M_Code__c,Renewal_MMC_Override__c,M_Code_Description__c,ParentQuoteId__c,ParentQuoteLineId__c,IsSelected__c,ExtendedDescription__c,Key__c,BaseSellingPrice__c,UnitSellingPrice__c,TotalOptionsSellingPrice__c,TotalBaseSellingPrice__c,NestedProductsSellingPrice__c,OptionsSellingPrice__c,OptionsListPrice__c,OptionsCost__c,OptionsProfit__c,OptionsMargin__c,TotalCost__c,TotalProfit__c,TotalMargin__c,IncludeInExport__c,Sequence__c,OptionId__c,OptionType__c,ValueType__c,ValueString__c,ValueDate__c,ValueDouble__c,ValueColor__c,Extended_List_Price__c,Total_Post_Program_Discount__c,Standard_Discount__c,Standard_Discount_Value__c,List_Monthly_Maintenance_Charge__c,Quote_Monthly_Maintenance_Charge__c,Contractual_Rev_Rec_Trigger__c,Oracle_Site_Number_for_BillTo__c,Oracle_Site_Number_for_Install__c,Oracle_Site_Number_for_ShipTo__c,Parent_LIC__c,IA_Account_Name__c,IA_Contact__c,IA_Contact_Role__c,IA_Country_of_revenue__c,IA_Oracle_customer__c,IA_Oracle_Site_Number_for_Install__c,IA_End_User_account_site_ID__c,IA_Address_Usage__c,IA_Address__c,IA_City__c,IA_State__c,IA_Postal_Code__c,IA_Country__c,IA_Select_Installed_At_Contact__c,Marketing_Name__c,Pricing_Comments__c,Freight_Terms__c,Solution_Line_Item__c,Warranty_Cost_Accrual__c,Product_Level__c,Cost_Adjustments__c,Revenue_Adjustments__c,Warranty_Cost__c,Unit_of_Measurement__c,CPQ_Line_Number__c,Order_Code__c,Adjust_Lock__c,CPQ_Line_Id__c,S_Level_Line_Item__c,Product_Cost__c,IP_Flag__c,IPSN__c,Email__c,Shipment_Note__c,HW_Gross_Revenue__c,SW_Gross_Revenue__c,HW_Def_Maint_Revenue__c,SW_Def_Maint_Revenue__c,Install_Revenue__c,GSS_Revenue__c,Total_Products_Cost__c,Revenue_Adjustment_Value__c,Cost_Adjustment_Value__c,HW_Term__c,HW_MMC__c,SW_Term__c,SW_MMC__c,Third_Party_HW_Term__c,Third_Party_HW_MMC__c,Third_Party_SW_Term__c,Third_Party_SW_MMC__c,Gross_Revenue__c,SVC_Support_List_Price__c,Pricing_Category__c,Product_Category__c,VSOE_Discount__c,Hidden_Line_Number__c,Unit_List_MMC__c,Unit_Std_Buy_Price__c,Unit_List_Price__c,Select_Ship_To_Address_Usage__c,Select_End_User_Address_Usage__c,Solution_Level_Order_Code__c,S_Level_Order_Code__c,Product_Sequence__c,VSOE_Flag__c,ST_Contact_Email__c,BT_Address_Usage_Site__c,ST_Address_Usage_Site__c,Ref_QuoteLineItem__c,CPQ_Parent_Line_Id__c,Service_Sub_Type__c,Standard_Cost__c,Quote_Id__c,LIC_EXP__c,ELA_Cost__c,ELA_Revenue__c,Covered_Product_Quoteline_Id__c,ENC_R_count__c,CPQ_Parent_Quote_Id__c,BT_LocationNo__c,ST_LocationNo__c,EU_LocationNo__c,CPQ_Root_Line_Id__c,Total_PII__c,Renewal_MMC_List__c,Covered_Product_Quantity__c,Covered_Product_Sequence__c,MPD_Amount__c,Unit_PII__c,Post_Program_Discount_Amt__c,Unit_WCA_Amount__c,WCA_Flag__c,WCA_Term__c,Ref_Quote_Line_Item_Root__c,E_U_Address_Variation1__c,S_T_Address_Variation1__c,Quote_Line_Item_Reporting_Count__c,ECCN__c,Unit_Gross_Revenue__c,Total_Covered_Product_Qty__c,Product_life_Cycle_Status_Test__c,Line_No_Sort__c,Unit_Start_Price__c,S_Product_Family__c,Unit_Post_Program_Price__c,Service_Level__c,Opp_Acct_Formula__c,Pricebook_ID__c,Product_Life_Cycle_Test__c,Gross_Revenue_PCU__c,Net_Revenue_PCU__c,Gross_Margin_PCU__c FROM QuoteLineItem WHERE QuoteId = '0Q055000000ADSOCA4'
12:43:55.115 (7115185345)|SOQL_EXECUTE_END|[381]|Rows:1767
12:43:55.115 (7193873495)|USER_DEBUG|[384]|INFO|mikem1a.Number of Queries: 2
12:43:55.115 (7193919303)|USER_DEBUG|[385]|INFO|mikem2a.Number of rows: 1815
12:43:55.115 (7193967779)|USER_DEBUG|[386]|INFO|mikem3a.Number of script statements: 0
12:43:55.115 (7194014499)|USER_DEBUG|[387]|INFO|mikem4a.Amount of CPU Time: 5352
 
I have a trigger that is creating a ton of errors. 

Active Contact Trigger - This trigger counts the number of active contacts (contacts that have been touched by the account owner in the last 14 days) and displays the total number on the Account. 
  • ERRORS THAT I AM GETTING FROM THIS TRIGGER: 
    • ActiveContact: execution of AfterUpdate caused by: System.DmlException: Update failed.
    • ActiveContact: System.LimitException: ApexCPU time limit exceeded
Here is the trigger itself: 
trigger ActiveContact on Contact (after insert, after update) {
    Contact[] cons;
    if (Trigger.isDelete) 
        cons = Trigger.old;
    else
        cons = Trigger.new;
    // get list of accounts
    Set<ID> acctIds = new Set<ID>();
    for (Contact con : cons) {
            acctIds.add(con.AccountId);
    }
    Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
                                                            ,AccountId
                                                            from Contact
                                                            where AccountId in :acctIds
                                                            AND Active_Contacts__c = 1 ]);
    
    Map<ID, Account> acctsToUpdate = new Map<ID, Account>([select Id
                                                                 ,Number_of_Active_Contacts__c
                                                                  from Account
                                                                  where Id in :acctIds]);
                                                                 
    for (Account acct : acctsToUpdate.values()) {
        Set<ID> conIds = new Set<ID>();
        for (Contact con : contactsForAccounts.values()) {
            if (con.AccountId == acct.Id)
                conIds.add(con.Id);
        }
        if (acct.Number_of_Active_Contacts__c != conIds.size())
            acct.Number_of_Active_Contacts__c = conIds.size();
    }
    update acctsToUpdate.values();
}


Can anyone give insight into why I am getting these errors? 
 
Hi guys,
I am new to salesforce i don't know how to write the test class for trigger.Please,help me
This is my trigger:
trigger trigger_name on Task (after insert, after update) {


    List<Messaging.SingleEmailMessage> Smail = new List<Messaging.SingleEmailMessage>();
   
    /* EmailTemplate ETemplate = [Select id from EmailTemplate where DeveloperName=:'Call_Notes']; */

        List<Id> taskAccountId = new List<Id>();
    Task ttask = Trigger.New[0];
   
    for(Task tsk : Trigger.New){
     if(tsk.AccountId != null && tsk.Send_Email_to_Customer_Team__c == 'Yes')
           taskAccountId.add(tsk.AccountID);
      }   
   
    String S1 =  'CALL NOTES \n =========== \n Call Reason: ' + ttask.Call_Reason__c  + '\n Contact Date:' +  ttask.Contact_Date__c  + '\n Type:' + ttask.Type;   
    String S2 =  '\n Attendees: ' + ttask.Attendees__c   + '\n ISG Rep1: ' + ttask.ISG_Rep1__c   + '\n ISG Rep2: ' + ttask.ISG_Rep2__c   + '\n Product Officer1: ' + ttask.Product_Officer1__c   + '\n Product Officer2: ' + ttask.Product_Officer2__c   + '\n Other1: ' + ttask.Other1__c;
    String S3 =  '\n Other2: ' + ttask.Other2__c   + '\n Comments:' + ttask.Description;
    String Txt_Body = S1 + S2 + S3;
   
  
    for(AccountTeamMember acctMem : [Select UserId, Account.Name, TeamMemberRole from AccountTeamMember Where AccountId IN:taskAccountId]){
      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();  
      mail.setTargetObjectId(acctMem.UserId);
      mail.subject = 'Call Notes Notification - ' + acctMem.Account.Name + '(Account Team)' ;
      mail.setUseSignature(true);
      mail.setBccSender(false);
      mail.setSaveAsActivity(false);
      mail.setSenderDisplayName(' Call Notes Notification');
      //mail.setTemplateId(ETemplate.Id);
      mail.setPlainTextBody(Txt_Body);
     
           
      Smail.add(mail);
    }  
    Messaging.sendEmail(Smail);
}

Thanks in Advance
Here is my code Any help is appreciated
trigger Testopp on Opportunity (after insert, after update) {
    for(Opportunity opp:Trigger.new){
        if(opp.StageName=='Closed Won'){
            OpportunityLineItem op=new OpportunityLineItem();
            op.Demo5__Ready_to_close__c = true;
        }
    }
        


}
In Setup, I have so many apex classes or VF pages, I dont want to browse page by page to locate a class, I have used Quick Find/Search box to find a class but it returns 0 item.
I have to browse every page to find a class, it is very inconvenient.
Please tell me how to find quickly a class or Vf page.

thanks

 
I have a simple trigger that updates a field.  My test class is not passing, however gives 80% coverage on the trigger.  

Here is the trigger:

trigger Update_MQL on Lead (before insert, before update) {
for (Lead myLead : Trigger.new)
{
    if (myLead.MQL_Date__c == null && (myLead.Status =='MQL (Marketing Qualified Lead)' || myLead.Status == 'SAL (Sales Accepted Lead)'))
    {myLead.MQL_Date__c = system.today();
    }else { myLead.MQL_Date__c = myLead.MQL_Date__c;
    }
     }
     
}


Here is the test class:

@isTest 
public class TestUpdate_MQL {
    static testMethod void insertNewLead() {
    
    Lead newLead = new Lead();
    
    newLead.FirstName = 'Mike';
    newLead.LastName = 'DeMille';
    newLead.Status = 'MQL (Marketing Qualified lead)';
    newLead.LeadSource = 'Advertisment';
    
    insert newLead;
    
 
       System.assertEquals(system.today(), newLead.MQL_Date__c);
    
    }
    
    }


What needs to be fixed?
Hi

I am having an issue with this exercise. Even though my locale is set to English (US) my currency is stil showing GBP so I cannot finish the task

Is there any other way I can change this?

Many thanks
Zara
//BlockContentLinkTrigger
trigger BlockContentLinkTrigger on ContentDocumentLink (before insert) {  
    for(ContentDocumentLink  contDocL : Trigger.new) {
            contDocL.addError('Pièce joint bloquée depuis objet ContentDocumentLink');
   }  
}

 
Hi guyz,

I'm trying to  display serial number of record using vfp, standard list control. using below code:
 
<apex:variable var="rowNo" value="{!0}"/>
            <apex:pageblocktable value="{!cnts}" var="cnt">
                <apex:column headerValue="Sl.No">
                    <apex:variable var="rowNo" value="{!rowNo+1}"/>
                    {!rowNo}
                </apex:column>
using above code for first colum,
here my problem is while using pagination in second page also serial no starts with 1. instead of 11,12,13..etc.
kindly give suggestion.
i'm a learner.
 

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?
I am wrting sql query for getting count,avg,sum,min,max aggregate functions at apex class. but i am getting this error.  please help.
 
Error: Compile Error: Illegal assignment from List<AggregateResult> to Integer at line 12 column 1  


public class soqlfunc
{
public integer count12{set;get;}
public integer avg{set;get;}
public integer sum{set;get;}
public integer max{set;get;}
public integer min{set;get;}

public soqlfunc()
{
count12=[select count() from transaction__c ];
avg=[select avg(amount__c) from transaction__c];
sum=[select sum(amount__c) from transaction__c   ];
max=[select max(amount__c) from transaction__c   ];
min=[select min(amount__c) from transaction__c   ];
}
}

 
Receiving following error on chatter approvals for Cas object
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: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: [nextApproverIds]: [nextApproverIds]
I do not have a clue as to missing information. This was a very confusing exercise for me. Newbie I am