Salesforce has an out-of-the box setting to allow skipping validation rules when you CONVERT a Lead.
However, this setting is not available by default if your organization was created sometime before 2010 i believe. You could however, raise a case with Salesforce and they will enable the feature for your i both your production and sandbox instances.
Below is a screenshot of how it looks, if you do not see this option please contact Salesforce customer support and get it enabled.
However, this setting is not available by default if your organization was created sometime before 2010 i believe. You could however, raise a case with Salesforce and they will enable the feature for your i both your production and sandbox instances.
Below is a screenshot of how it looks, if you do not see this option please contact Salesforce customer support and get it enabled.
Trigger
Apex Class:
The system throws a compile error : Method does not exist or incorrect signature even though everything seems correct. This is because the methods should be defined as static. Below is the corrected code. SOLUTION:
Apex Class:
The system throws a compile error : Method does not exist or incorrect signature even though everything seems correct. This is because the methods should be defined as static. Below is the corrected code. SOLUTION:
With Reporting Snapshots, you might come across this error message.

When you click into the row, it shows you the list of fields that have not been mapped properly.
Solution:
Check your mappings and the data type between the source and target fields. If that still does not solve the issue, check that the RUNNING USER has access to the source and target fields.
In this case, the 'Admin User' did not have access to the source fields and hence this error message.
When you click into the row, it shows you the list of fields that have not been mapped properly.
Solution:
Check your mappings and the data type between the source and target fields. If that still does not solve the issue, check that the RUNNING USER has access to the source and target fields.
In this case, the 'Admin User' did not have access to the source fields and hence this error message.
LAST_N_DAYS:20
This clause means LAST 20 Days.
Using this in a SOQL Query to fetch the List of Cases created 30 days ago, the query will be
THIS_WEEK
This clause fetches records created this week. The Week is calculated as per the notes from Salesforce as :Starts 12:00:00 on the most recent first day of the week before the current day and continues for seven full days. First day of the week is determined by your locale.
More Links and methods:
Apex Date Filters: http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm
List View Filters: https://help.salesforce.com/apex/HTViewHelpDoc?id=custom_dates.htm&language=en
This clause means LAST 20 Days.
Using this in a SOQL Query to fetch the List of Cases created 30 days ago, the query will be
List<Cases> allCases = [Select Id from Cases where CreatedDate >= LAST_N_DAYS:30];
THIS_WEEK
This clause fetches records created this week. The Week is calculated as per the notes from Salesforce as :Starts 12:00:00 on the most recent first day of the week before the current day and continues for seven full days. First day of the week is determined by your locale.
List<Cases> allCases = [Select Id from Cases where CreatedDate < THIS_WEEK];
More Links and methods:
Apex Date Filters: http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql_select_dateformats.htm
List View Filters: https://help.salesforce.com/apex/HTViewHelpDoc?id=custom_dates.htm&language=en
Salesforce Documentation: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_recordtype.htm
You might have to set or update the RecordType of records dynamically using Apex Triggers. In such cases, the RecordTypeId should be queried and fetched at runtime using the below two approaches.
SOQL:
RecordType RecType = [Select Id From RecordType Where SobjectType = 'Contact' and DeveloperName = 'Strategic_Contact'];
The Developer name corresponds to the RecordType Name as shown below.The other method is to use the Describe call.
MaprtMapByName = d.getRecordTypeInfosByName(); Schema.RecordTypeInfo rtByName = rtMapByName.get('Strategic_Contact');
Apex imposes the following restriction.
A single Apex transaction can make a maximum of 10 callouts to an HTTP request or an API call.
There might be cases where you would want to make more than 10 callouts. In such circumstances, you could handle the callouts asynchronously.
Use the <apex:actionfuntion> tag. ActionFunction allows you to call an apex function from JavaScript, and these functions get called asynchronously. Meaning that, the count as individual transaction.
If your API calls are independent of each other, and does not rely on information returned from a previous API then use actionfunctions to overcome this restriction.
NOTE: Actionfunctions execute asynchronously, there is no definite order in which they execute.
A single Apex transaction can make a maximum of 10 callouts to an HTTP request or an API call.
There might be cases where you would want to make more than 10 callouts. In such circumstances, you could handle the callouts asynchronously.
Use the <apex:actionfuntion> tag. ActionFunction allows you to call an apex function from JavaScript, and these functions get called asynchronously. Meaning that, the count as individual transaction.
If your API calls are independent of each other, and does not rely on information returned from a previous API then use actionfunctions to overcome this restriction.
NOTE: Actionfunctions execute asynchronously, there is no definite order in which they execute.

