Ubuntu | Rsync

Author - Rita

Ubuntu provides a very useful command rsync that allows faster way to copy modified files from one location to another. It can work between 2 remote locations or even within local folders. First time rsync downloads all the files but when this command is executed next time, it will download Read more…

Salesforce | How to add page header image in a visualforce page?

Author - Webner
|
0 Comments
|

We can add the page header image in a visualforce page using following apex tag:

<apex:image id=”” value=”” width=”” height=””/>

In “value” Field of tag we give the url of the image where image is located. Image may be located in static resources in Salesforce or somewhere Read more…

Salesforce | System.VisualforceException: Getting content from within triggers not supported

Author - Webner
|
1 Comment
|

Problem: System.VisualforceException: Getting content from within triggers is currently not supported.

Description: This Visualforce exception occurs when we use getContent method in the trigger of sobject.

Here is the code for which we got this exception:

Trigger code:
trigger updateStatus on sobject (before update) {
List List = new List();
for Read more…

Page break in PDF not working when table is created in loop

Author - Webner
|
0 Comments
|

Problem: Page break in PDF was not working when table was created in loop. We wanted to have certain amount of rows on same page. If there was not enough space then next set of rows automatically shifted to the next page.

Solution: We can not use the page break Read more…

Moodle | Flash SCORM modules not showing content on shared hosting

Author - Webner

We faced a problem that Scorm content packages uploaded in Moodle were not displaying content correctly on shared hosting server. After entering the Quiz the page was redirecting back to the same page rather than displaying the further pages of the quiz. The reason was cgi.fix_pathinfo property having value Read more…

Moodle | Assign users as site administrators in Moodle/Totara

Author - Webner
|
0 Comments
|

In Moodle, we can allow users to have administrative access to site. We can enable users for this access by using the following steps:

1. Navigate to Site Administration > Users > Permissions.
2. Click on the Site administrators link.
3. It will open the settings page to Read more…

WordPress accessing custom fields in code

Author - Kajal Marwaha
|
0 Comments
|

In WordPress you can use following code for accessing value of custom fields:

$key_name = get_post_custom_values($key = ‘Key Name’);
echo $key_name;//display the value
Here ‘key name’ is name of the custom field.
get_post_custom_values() is a function in WordPress, which is used to get the custom value of a field which Read more…

Selenium | Unable to find Command button using Selenium Webdriver

Author - Webner

Problem: Unable to find the Command button using Selenium Webdriver.

Solution: You can use following script code if you want to find command button on a web page and then click it:
driver.findElement(By.xpath(“//button[text()='(Button name)’]”)).click();
Here is the script which we used in Read more…

Download the PDF in Landscape mode using MPDF

Author - Webner
|
0 Comments
|

While downloading the PDF from standard portrait mode to landscape mode, first of all you need to set the style in % (no hard coding of width or height). Then make an object of mpdf class.

This is how we created the object :

$mpdf=new mPDF(‘c’, ‘A4-L’); “-L” is Read more…

Chargify | Single php function for all Chargify API calls

Author - Ishpreet Kaur

Following single function can be used for all Chargify API calls whether API calls belong to test site (site for test transactions) or live site (live transactions):
<?php
function sendRequest($uri, $method, $data = ”)
{
$apiKey = ‘XOTUsyy7pJ6yLgmMa233AtJ’;
$subdomain = ‘abccompany-test’;
$username = $apiKey;
$password = ‘x’;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL Read more…

Java | How to Create Entities from existing database in eclipse (ubuntu)

Author - Rita

Follow steps below to generate JPA Entity classes automatically in Eclipse:

Step 1: Create a simple java project and convert it to JPA Project using following steps:

1.1.  Right Click on your Project.

1.2.  Select Configure option from the menu.

1.3.  Select Convert to JPA Read more…

javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher

Author - Webner

We were getting following exception when trying to decrypt data using Cipher:

javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher

Actually we were using three layers of encryption with three different secret keys. Everything was right when we were encrypting our data. Keys Read more…

Salesforce | How to get Salesforce lookup field object id using javascript

Author - Webner

Suppose we have the following lookup field on a VF page:
<apex:inputField id=”owner” value=”{!Event.Ownerid}”>
</apex:inputField>
To get value of above lookup field using field id in javascript, if we directly use document.getElementById(‘{!$Component.owner}’).value, it will return Read more…

Salesforce | [message:protected] => INVALID_LOGIN: Invalid username, password, security token; or user locked out

Author - Kiran Preet

While upserting records using SFDC php API we were facing following exception :

[message:protected] => INVALID_LOGIN: Invalid username, password, security token; or user locked out.

This exception was showing up frequently when we were upserting records using PHP API. The username, password and security token which we were using were Read more…

Linux | Multi Factor Authentication (MFA) without password

Author - Navneet Kashyap

When implementing Multi Factor Authentication (MFA) for linux server with ssh-key and google-authenticator only with no password it was prompting us to enter password for user but we wanted authentication without password.

Steps to solve this:

1.  Install google authenticator (centos 64-bit) in a new Read more…

AWS S3 | How to get the count of files in a folder in AWS S3

Author - Kiran Preet
|
0 Comments
|

There was a task in which we were required to get each folder name with count of files it contains from an AWS S3 bucket. If we used the general approach to start a counter and increment that in a foreach loop we were getting the exact count of files Read more…

Java | Remove duplicate objects from Java Hashsets and Hashmap keys

Author - Webner

In Java, a Hashset, theoretically, cannot contain any duplicate values but it is not valid when you store user defined objects in it. Same is true in case of Hashmap keys which supposedly cannot be duplicate. The reason is, how will Java interpreter know if our custom defined objects are Read more…

JQuery | Check/uncheck the radio button on click using jquery

Author - Ishpreet Kaur
|
0 Comments
|

When we click radio button, it gets checked. Once it gets checked it doesn’t get unchecked when again clicked. We can use checkbox for checked/unchecked status of input, but sometimes requirement arises when we need to use radio button for checked/unchecked status instead of checkbox.

Solution:

Suppose Read more…

Salesforce Integration | Upsert multiple records with single connection in PHP

Author - Kiran Preet

When we create connection with “SforceEnterpriseClient”, we can upsert one record and then we need to recreate connection for next upsert, which eventually can result in the exception:
“UnexpectedErrorFault: REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.”
The solution is to use “SforcePartnerClient” instead of “SforceEnterpriseClient”.

An example with steps to upsert records in Read more…

Java | What is the default location for maven repository and how we can modify it

Author - Rita

To print maven default configurations, run following command:

Command:
mvn -X
This will show you maven default configurations similar to following:
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386 Read more…

‹ Prev page1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 Next page ›
Send your message