Problem: How to attach PDF from a Visualforce page in email using apex class or trigger?
Description: We had a Visualforce page name ‘templateCOI’ which was rendered as a PDF. We wanted to use this page as an attachment in the automated email on a trigger.
Solution: Here is the Read more…
For Windows user:
1. Open folder that contains files in console
2. type dir /b > D:test.txt (it will copy the result in test.txt file)
For Linux user:
1. Open folder that contains files in console
2. type ls > /home/user/test.txt (it will copy Read more…
In one of our Totara theme projects, we wanted to display the categories->subcategories->courses structure dynamically up to any level. In Totara a category can have subcategories, each subcategory can have its own set of subcategories and so on up to any level. Also Courses can appear at any Read more…
Steps to install cordova/phonegap
To install cordova from command line, follow these steps
Download and install Node.js
$ sudo apt-get install node.js
Node.js is a runtime system for creating server-side applications.
Download and install npm
$ sudo apt-get install npm
npm is the Read more…
The Isset () Function:
The isset () function is used when we have to check whether a value in the variable is set or not. It returns false when variable contains null values.
For Example, values are stored in a session so that it can have access to another web Read more…
1. Accept vs Except vs Expect:
Accept: To approve/to agree.
Example: I accept the new business proposal.
Except: Leaving someone or something.
Example: The new software works on every operating system except Windows 98.
Expect: To hope.
Example: I expect this code will run successfully.
2. Loose vs Lose Read more…
In HTML, padding can be given to the text in following ways:
It is more appropriate to use “%” than “px”. The reason for this is when Read more…
Sometimes, we need to check when was the data last accessed. In MySQL, we had taken a field last_modified_time as timestamp datatype in a table, which was set to CURRENT_TIMESTAMP by DEFAULT.
When a new record was inserted, it automatically updated the field and set the current datetime into this Read more…
On closing child popup window (on click of a button), we wanted to refresh the parent window automatically to check the updates.
<apex:page Read more…
On creation of the new custom object, you will see search layout section on custom object detail page. Using Winter 16 Release, this section is not there, as in winter 16, search layout section is not enabled automatically.
Allow Search Features:
1. You can disable or enable search layout for Read more…
To Check if the domain of an email address is valid or not, pass the email address to the below method as an argument and execute it, it will return true or false by checking if the email id you entered has valid domain or not :
private static boolean doLookup Read more…
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<?php echo utf8_decode(“selecciona una categoría”);?>
Above two lines are used to decode the special characters properly. We use the meta tag in section of the page to decode the whole page and second Read more…
If you want to hide all following siblings of an element with jQuery then you can use next() function. This function is used to get following siblings (means siblings that occur after selected element) of matched element. If a selector is provided, it retrieves the next sibling only if it Read more…
In one of our projects we were working on, website page’s styling was not uniform when viewed on different browsers.
To solve this problem, we used CSS hacks for Safari and IE 11.
Tag for CSS hacks in IE 11:
@media all and (-ms-high-contrast: none),(-ms-high Read more…
While working in eclipse, we faced a problem in which Ctrl+click was not redirecting to the parent function or class.
Solution: To solve this problem, we followed the below steps :
1. Exit Eclipse
2. Go to Workspace
3. Open .metadata folder
4. Open .plugins folder
5. Search for folder Read more…
Suppose we have a complex array like below:
$products = array(
‘product’ => array(‘id’ => 1, ‘name’ => ‘Jquery tutorial book’),
‘product_details’ => array(‘cost’ => 10, ‘edition’ => ‘first’)
‘product_details’ => array(‘cost’ => 20, ‘edition’ => ‘first’)
‘product’ => array(‘id’ => 3, ‘name’ => ‘C++ tutorial book’),
‘product_details Read more…
Here is the code to get names of app package installed on iOS devices:
include objc/ runtime.h in your viewController.m
Class LSApplicationWorkspace_class = objc_getClass(“LSApplicationWorkspace”);
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
NSArray *array = [workspace performSelector:@selector(allApplications)];
NSMutableString *packageList = [NSMutableString stringWithString Read more…
If your webpage has a lot of images it may load really slowly. We can use jQuery method lazyLoad to load the page faster. Lazy Load delays loading of images in long web pages. Images outside of viewport (means part of the screen you are viewing) are not loaded until Read more…
A theme can be installed in Moodle/Totara by two different methods:
A) Installing theme via FTP
1. Login to your FTP client server where your Moodle/Totara is installed
2. Go to Moodle “Theme” directory and place the theme folder which you have extracted from the Zip in it Read more…
Follow the steps below to restrict back button of the browser:
1. Make a custom filter class as shown below.
2. Implement Filter (in-built interface)
3. Override “doFilter” method present in the Filter interface:
public class NoCacheFilter implements Filter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain Read more…