Wednesday, May 7, 2014

APEX Test class failing due to @Future Calls limits


Most recently we faced a issue with @Future calls with governor limits going over 10 in Test Class execution during deployments. During investigation we found it to be due to test data being created more than 10 times and every test data is initiating the method with @Future call. So in the end the governor limit is crossing. We thought of all options like removing @Future call altogether as an alternative, but the best solution for these type of issues where you cannot afford to remove @Future call is  -  to put below line of code wherever methods with @future call are triggered.

if(Test.isRunningTest() && Limits.getFutureCalls() >= Limits.getLimitFutureCalls()) {
     system.debug(LoggingLevel.Error, 'Future method limit reached. Skipping call to Future Method);
 } else {

    CallMethodWithFutureCall();


Friday, July 12, 2013

Important points to remember before you face any Salesforce.com Interview



Configuration

  1. What are  different types of Editions?
  2. What is Report Types?
  3. What is Record Types?
  4. Difference b/w Hashtags and Topics?
  5. What is Web To Lead?
  6. What is wsdl to apex?
  7. Explain security Model supported in SFDC?
  8. Why Permission Sets are important even though Profiles are available?
APEX
  1. Difference between List and Set ?
  2. Difference between SOQL and SOSL?
  3. How to convert lead using APEX?
  4. How to prevent recursive call of trigger ?



Design 
  1. Why Multi-Organization salesforce implementations suited in some scenerios?
  2. How data synchronization , data consolidation and data migration supported in Multi - org implementations?
  3. What are deployment methodologies supported in SFDC Cloud?
  4. Disadvantages of SFDC Cloud?
  5. If client requirement is creation of just some custom object , sharing data with external application and Data loader support to load data into the custom object. What is the best edition to support all these requirements?
  6. How salesforce support WSDL based integration?

Wednesday, June 26, 2013

Salesforce.com Certified Force.com Developer - Spring '13 Release Exam

1. What is a consideration when setting up the beta version of the State and Country Picklists feature?
  Choose 2 answers


A. Validation rules must be created to enforce data entry standards.
B. State and country picklists are available on certain standard objects.
C. Planning and feature enablement require working with salesforce.com.
D. Reports, email templates, and list views are automatically updated.
Ans:
B. State and country picklists are available on certain standard objects.
D. Reports, email templates, and list views are automatically updated.

2. What is a feature of the Salesforce multitenant architecture?
  Choose 2 answers


A. A tenant can view data belonging to other tenants.
B. A tenant can perform an unlimited number of database operations.
C. Tenants share hardware resources, such as memory and CPU.
D. Data is associated to a specific tenant by an assigned OrgID.
Ans:
C. Tenants share hardware resources, such as memory and CPU.
D. Data is associated to a specific tenant by an assigned OrgID.


3. When would a developer use criteria-based sharing rules to provide wider access to data?

A. To share all job application records marked as "Ready for Review" with the human resources team.
B. To share all job application records owned by a recruiter with all other recruiters in the same role.
C. To share all job application records owned by a recruiter with the users below them in the role hierarchy.
D. To share all job application records owned by a recruiter with the users above them in the role hierarchy.

Ans:
A. To share all job application records marked as "Ready for Review" with the human resources team.


4. What is true of a lookup relationship?
  Choose 2 answers


A. A lookup relationship supports roll-up summary fields.
B. Both the parent and child objects have their own sharing rules.
C. When a child record is deleted, the parent record is deleted.
D. The child object can be either a standard or custom object.
Ans:
B. Both the parent and child objects have their own sharing rules.
D. The child object can be either a standard or custom object.

5. What statement is true about organization-wide defaults?
  Choose 2 answers


A. Organization-wide defaults are the only way to restrict data in the sharing model.
B. In a lookup relationship, child records inherit organization-wide defaults from the parent record.
C. Organization-wide defaults override the create, read, edit, and delete object permissions.
D. In a master-detail relationship, detail records inherit organization-wide defaults from the master record.
Ans:
A. Organization-wide defaults are the only way to restrict data in the sharing model.
D. In a master-detail relationship, detail records inherit organization-wide defaults from the master record.

6. What is true of a master-detail relationship?
  Choose 2 answers


A. The detail record can be re-parented to a different master record.
B. The detail record is deleted when the master record is deleted.
C. When the detail record is deleted, the master record is also deleted.
D. The detail record can be either a standard or custom object.
Ans:
B. The detail record is deleted when the master record is deleted.
D. The detail record can be either a standard or custom object.

Wednesday, March 28, 2012

Polyglot Platform

Platform as a service (PaaS) like Salesforce, Heroku has evolved a new range of programmers called as Polyglot programmers; these programmers normally know  multiple languages.I have seen the era where a programmer used to code and master in single language across this career. But now that era is about to vanish and with the success of cloud and platforms like Heroku which support multiple languages on a single platform making demand of Polyglot programmers. This is amazing change going over and I am lucky to witness and part of it.....


I will keep posting on this.....


Thursday, February 23, 2012

Salesforce.com - Common issues while creating APEX from WSDL file

I faced lots of issues while creating APEX classes Generated by wsdl2apex tool of Salesforce. I really want to take note on some nasty ones which keep our days/night busy.

If you ever had chance to work this yourself you must know that Salesforce does not support WSDL with <Import> tags; it means if your client or fellow external application team member provides you a WSDL which have couple of these tags then Salesforce will straightaway reject these saying <import> is not supported. Only solution to work this is manually copying the referenced schema to the parent wsdl file.

Let say you WSDL file looks something like this..this is an example of Referenced Schema

 <wsdl:types>
   <xsd:schema targetNamespace="test.namespace">
      <xsd:import schemaLocation="testlocation" namespace="test.namespace"/>
    </xsd:schema>

 </wsdl:types>

Here above highlighted import tags are not supported. The solution for the above issue is simple ; just copy paste the content of schema from location "testlocation" inside <wsdl:types>, thats it. Some times there are dozens of import statements in WSDL and it becomes deficult to manually do so and these manual changes are error prone. So I will recommend to search for some WSDL flatner tool for this. I have used this one couple of times  http://wsdlflattener.codeplex.com .

Also if your WSDL  contains reference to another WSDL like the one highlighted below; this is an example of Referenced WSDL


<wsdl:definitions name="testservice" targetNamespace="testns" >
    <wsdl:import namespace="testwsdl" location="testlocation"/>

       <wsdl:types>.........
         ........
         .......
       </wsdl:types>
         ...................
         ...................
</wsdl:definitions>


This situation requires pure manual intervention as this is not supported by any flattner tool as of now.In fact the correct statement would be I am not able to find such tool myself till now.Now the steps needed to resolve this are -

  • Use  http://wsdlflattener.codeplex.com tool and create the flattened file.This will copy the Schemas from referenced WSDL location and auto merge some of the <WSDL:definition> tags.
  • Go to the referenced WSDL file ; copy the following tags from the referenced location to the parent WSDL - <wsdl:message> and <wsdl:portType>
  • Copy the targetnamespace="xyzee" from referenced WSDL location to <WSDL:definition> of Parent.
  • You need to check if any other namespace is required to be copied from referenced WSDL to  Parent WSDL:definition; you can do this my comparing the namespaces used.


Hope these steps will resolve some of your issues if you comes up with problems.








Tuesday, February 1, 2011

System.InvalidOperationException: Modifying a LOB requires that the connection be transacted


Most recently we spent our nights debugging an issue which comes up only at client's environment and not else where.The issue was
"System.InvalidOperationException: Modifying a LOB requires that the connection be transacted."

At the end it came out to be a environmental issue.If this issues comes up than there can be two reasons for this

Monday, December 6, 2010

Oracle Import Data Pump common issues ORA-39002: invalid operation , ORA-39001: invalid argument value

Import Data pump and Export Data pump utilitities when used ommonly give following errors.

ORA-39002: invalid operation + ORA-39070: Unable to open the log file. + ORA-29283: invalid file operation + ORA-06512: at "SYS.UTL_FILE", line 475 + ORA-29283: invalid file operation


ORA-39001: invalid argument value + ORA-39000: bad dump file specification + ORA-31640: unable to open dump file "c:\export\GeniePid2_20100828.dmp" for read + ORA-27041: unable to open file

Both of these issue came up when following import dump command was fired
impdp sys/password@tns directory=my_dir dumpfile=GeniePid2_AJ1.dmp remap_schema=GeniePid2:Pid2AJ1 logfile=GeniePid2_AJ1.log TRANSFORM=oid:n

Solution
  1. Create a directory or folder by any name like c:\export in Server Machine (Not Client machine).Please make sure this path must reside where Oracle server is running ; nobody told this to me and I kept banging my head for 2 hours.
  2. Create a directory which is logical or use by oracle for doing export or import grant the users dba role or exp_full_database or imp_full_database as per your usage
          SQL>create directory my_dir as ‘c:\export\';

          SQL> grant read,write on directory my_dir to public;

Both these points resolved my issue.