Mysql Workbench | How to copy Remote database into your local machine

| By Webner

1.  Select Database: Schema Transfer Wizard from the Mysql workbench menu bar. You will see schema transfer wizard on your screen as below: Click on Start the Wizard option. 2.  Connection Selection: Now select your source and destination location to copy database:

Salesforce | Send email using apex code along with attachment and manage email history

| By Webner

1. Send simple email using apex : Messaging.SingleEmailMessage emailTobeSent = new Messaging.SingleEmailMessage(); List <String> listEmailMembers = new List<String>(); listEmailMembers.add(’email@domain.com’); emailTobeSent.setToAddresses(listEmailMembers); emailTobeSent.setSubject(‘Hi, Just Testing’); emailTobeSent.setHtmlBody(‘msg : ‘ + msg); Messaging.SendEmailResult [] r1 = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {emailTobeSent} 2. Use template instead of

Salesforce | Set CreatedDate for s-object records in test class

| By Webner

In some cases, we need to set CreatedDate for records. setCreatedDate() method can be used to set CreatedDate for records. For Example : Set createddate for a contact in test class Contact con = new Contact() con.FirstName=’Firstname’; con.LastName=’LastName’; insert con;

Using UNION syntax in CakePHP 2.4.6

| By Webner

Following UNION syntax works properly in CakePHP 2.4.6 version but it doesn’t work in CakePHP 2.5.2 version: $unionQuery = $dbo->buildStatement ( array( ‘fields’ => array( required fields), ‘table’ => $dbo->fullTableName(database_table_name), ‘alias’ => ‘customObject1’, ‘limit’ => null, ‘offset’ => null, ‘joins’

Salesforce | How to call apex method using Javascript

| By Webner

We can call apex method from javascript using JavaScript remoting. Javascript remoting has three main parts : 1. Invoke remote method written in javascript method on Visualforce page. 2. Remote apex method contains an annotation @RemoteAction. 3. The response handler