Salesforce | Refresh the parent window automatically on closing the child window

Author - Webner

On closing child popup window (on click of a button), we wanted to refresh the parent window automatically to check the updates.

We can refresh the parent window on closing the popup window by using javascript.

Syntax : This is sample javascript code of page loaded in popup:

<apex:page Read more…

Salesforce | Search Layout Section For Newly Created Objects

Author - Webner
|
0 Comments
|

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…

Java | Check if domain of an email address is valid or not

Author - Neha Mishra

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…

Issues of UTF-8 Encode Keyword

Author - Webner

<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…

jQuery | How to hide all right siblings

Author - Kajal Marwaha
|
0 Comments
|

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…

How to write CSS hacks for IE 11 and Safari

Author - Kajal Marwaha
|
0 Comments
|

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…

Eclipse | Ctrl+click doesn’t redirect to parent function or class

Author - Webner

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…

PHP | Sorting Complex Multidimensional Array

Author - Ishpreet Kaur

Suppose we have a complex array like below:

$products = array(
array(
‘product’ => array(‘id’ => 1, ‘name’ => ‘Jquery tutorial book’),
‘product_details’ => array(‘cost’ => 10, ‘edition’ => ‘first’)
),
array(
‘product’ => array(‘id’ => 2, ‘name’ => ‘javascript tutorial book’),
‘product_details’ => array(‘cost’ => 20, ‘edition’ => ‘first’)
),
array(
‘product’ => array(‘id’ => 3, ‘name’ => ‘C++ tutorial book’),
‘product_details Read more…

iOS | How to get installed app package names

Author - Vivek Gautam
|
0 Comments
|

Here is the code to get names of app package installed on iOS devices:

include objc/ runtime.h in your viewController.m
include <objc/runtime.h>
– (void)GetInstalledApps
{
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…

How to load webpage faster having large number of images

Author - Webner
|
0 Comments
|

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…

Moodle/Totara | How to install a new theme

Author - Webner
|
0 Comments
|

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…

Restrict back button of browser using Struts2

Author - Neha Mishra
|
0 Comments
|

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
{
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain Read more…

Toggling a checkbox on/off through Selenium webdriver

Author - Webner
|
0 Comments
|

Below is the script for on/off the checkbox using webdriver:
package mypackage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class myclass
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
String Read more…

How to create a dynamic div using Javascript

Author - Webner

Here is sample code if you want to create a dynamic div using Javascript:

<script type=”text/javascript”>
divCount =0;
function createDiv()
{
var divTag = document.createElement(“div”);
var studList =””;
studList += ‘<select id=”BOX_’+divCount+'” name=”BOX_’+divCount+'”>’;
studList += ‘<option value=””>— Select —</option&gt Read more…

Salesforce | Some Date functions (String to Date and more)

Author - Webner
|
0 Comments
|

We can convert a string variable into date datatype by using the apex date class function date.parse(String);

Syntax:

Date var1=date.parse(String);

Example:

String var=’12/25/2016’;

Convert var to date type by:
Date var1=date.parse(var);

Now var1 contain it as a date type Read more…

Android | How to get list of all the apps installed on Android device

Author - Vivek Gautam
|
0 Comments
|

In one of the mobile app we were required to get the list of all the installed applications on user’s mobile. This was possible but due to security reasons first of all you need to prompt app user to allow access his/her device contents by showing a dialogue Read more…

Selenium | How to test popup alert message in Selenium Webdriver

Author - Webner

Below is the script:
package mypackage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class myclass
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
String alertMessage = “”;
driver.get(“http://demo.webnerserver.com/view/sent_email.php”)
driver.findElement(By.cssSelector Read more…

Salesforce | Calculate number of years between two dates in apex class

Author - Shalini
|
0 Comments
|

Sample Code:

Date date1 = System.today();
Date date2 = System.today().addMonths(30);
system.debug(‘No of months === >>>> ‘ + date1.monthsBetween(date2));
String noOfYears = String.valueOf(date1.monthsBetween(date2) / 12) + ‘ Year(s) ‘ + String.valueOf(Math.mod(date1.monthsBetween(date2), 12)) + ‘ Month(s)’;
system.debug(‘No of years ‘ + noOfYears);

Output:

No of months Read more…

PHP | Amazon S3 | Check if a file or folder already exists on Amazon S3 Bucket

Author - Webner

To check if a file or folder already exists on Amazon S3 Bucket, use the following code

Code:
$info = $client->doesObjectExist($bucket, $FileName)
if ($info)
{
echo ‘File exists’;
}
else
{
echo ‘File does not exists’;
}

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Read more…

Salesforce | Visualforce | Error : DML currently not allowed exception on creation of the record on an Object

Author - Webner
|
0 Comments
|

When creating a record on the document object using Rest API, Salesforce did not allow to execute the DML command from the Visualforce component.

Reason: When we try to pass dynamic values from the Visualforce Component to the Apex method, Salesforce does not allow us to put any 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