Category: Web Development
Salesforce | Send email using apex code along with attachment and manage email history
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
How to add new custom HTML pages in Totara/Moodle
Totara / moodle does not have the default feature to add custom HTML pages and display on the site. But we can achieve this by installing a plugin: “General plugins (Local): Static Pages” Steps to install and use this plugin
Salesforce | Set CreatedDate for s-object records in test class
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
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
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
jQuery line control HTML editor | Post data to server
In jQuery line-control editor, values written inside writing space (div) do not get posted to the server by default. This is because although we create textarea while coding, at run time a DIV is created in which user writes. Editor.editor
Salesforce | The inner and outer selects should not be on the same object type on recordtype object
Problem: SOQL does not support using the same object name in the Subquery which is in use in outer Select. For Example: We wanted to get the name of the object values (Record type object) using the SOQL having two
Heroku | An introduction to Procfile and its use
Introduction: We can make our Heroku app run different type of processes by creating a Procfile in the app. There is a specific structure and syntax that we need to follow while creating a Procfile. Following are the main points
LESS Introduction | Dynamic CSS styling
LESS is an open source CSS pre-processor designed by Alexis Sellier in 2009. It is not exactly CSS but acts like one with the help of Javascript libraries that interpret the stylesheet and make it readable for browsers. The very