In one of our Salesforce projects we are working on, we had a custom object with an email trigger that was supposed to send email to the Related Contact. When we clicked the email button to trigger the email sending process, the Related Contact Id was not passed to the Read more…
Problem : How to show Email sent from Salesforce in activity history of an object
Solution : Here are the steps :
1. Set WhatId
2. Make SaveAsActivity true
Messaging.SingleEmailMessage emailTobeSent = new Messaging.SingleEmailMessage();
List ToAddress = new List();
emailTobeSent Read more…
Many websites use cookie messages to store information which is required by them for fulfilling various purposes which includes storing user’s login information, saving passwords Read more…
Maven provides apache cxf plugin to generate web service client.
We have used below code in our pom.xml file to generate java artifact classes (web service client).
There are two ways to generate client code:
Using complete WSDL URL
Using WSDL artifact
1. Using complete WSDL URL Read more…
In MySQL, we generally perform insert, update, select and delete operations on records of table. Multiple Insert operation can also be easily performed on table.
Take an example of Employees table with fields:
Multiple records can be inserted in Employees table in a single query using following MySQL query :
INSERT Read more…
Data Hygiene or Data Cleansing or Data Cleaning – call it by the name you prefer – all point to the process of making the data better than it is before the process is applied. “Better data” means removing what is not required, fixing what is not right, restoring data correctness, and Read more…
Footer is not visible or fixed at bottom, when virtual keyboard is opened in Phonegap/Cordova Application.
Consider following div create for footer :
<div data-role=”footer” data-position=”fixed” class=’custom_footer’ data-theme=’b’ data-tap-toggle=”false”></div>
To keep Footer fixed Read more…
We can show the picklist field value on Visualforce page in a selectlist ( dropdown) using the following code in the controller class:
public class classname
public List functionName
List options = new List();
Schema.DescribeFieldResult result = ObjectName.FieldName(pick list field name).getDescribe();
List pick = result.getPicklistValues();
for( Schema.PicklistEntry Read more…
Problem : How to grep only uncommented contents from any configuration file which is big in size, has many comments and blank lines
Solution: This can be achieved by following single command :
# grep -v ‘^$’ /etc/httpd/conf/httpd.conf | grep -v ‘^ *#’ | less
Explanation of command :
^$ : Matches and removes all blank lines Read more…
ERROR: Invalid email address or account number error on NetSuite, but passed correct credentials.
Need to authenticate NetSuite sandbox account through java application and fetch all the contacts. Below is the link to the WSDL file used to log in:
But on attempting the login with Read more…
MySql 5.5 is the default version for Ubuntu 14.04
Steps to Upgrade the mysql-server
If you have existing database in Mysql 5.5. It should be migrated automatically.
Take the backup of existing databases:
mysql> mysqldump –lock-all-tables -u root -p -all-databases > backup Read more…
We can create new Zoho Subscriptions via code by using PHP curl and with the help of Subscription APIs.
Below is the sample code which is required to create a subscription:
$headerArray = array(“Content-Type: application/json;charset=UTF-8”,
“Authorization: Zoho-authtoken ——–Auth Read more…
In simple pick list we can select only one value but in multi pick list we can select one or more values.
Scenario: We had to multi pick list data type field
Fields that we wanted to select :
Case 1 : Check if Read more…
In PHP if you want to replace multiple variables of the string at one go you could use strtr() instead of using str_replace().
$vars = array(
‘##reminders##’=> ‘ ‘,
$BODY=strtr Read more…
In one of our Totara theme projects, we wanted to hide default breadcrumbs and show our own breadcrumbs on activity page like columns 1, columns 2 or columns 3. To get the activity details for a particular activity, we can write custom queries but as there were multiple activities like Read more…
Description: Using a Split function over some special characters like ‘.’ is bit ambiguous, As Apex does not recognise these characters to be part of the splitting string.
For Example: //this will fail reporting a size of 0
string s = ‘first.second’;
part = s.split(‘.’);
System.DEBUG(part.size Read more…
Description: By default, CakePHP authentication is applied to all application controllers. So it does not allow users to perform any of the action without login.
Solution: Each controller has a beforeFilter method which runs when some action is called from controller. Add below lines to your method:
Public function beforeFilter Read more…
public class deleteEmptyStringQuick
public static void main(String args)
ArrayList arrayListOfEmptyString=(ArrayList) Arrays.asList(emptyStringArray);
//normally we will do this
ArrayList filteredList = new ArrayList();
for(String string: arrayListOfEmptyString)
//You can achieve this with single line as well:
filteredList Read more…
Description: In a dual boot system (Ubuntu/windows), if you delete the boot partition of ubuntu or delete the Linux operating system by formatting the drive then you will face the grub rescue problem.
In this problem we have two cases:
You have deleted the boot partition of Read more…
The header function in the above code does not work. But when we remove the echo from the code, it works properly.
Code after removing echo :
header(“location:https://subscriptions Read more…