How to specify an extra field (not existing in the table) while fetching data from database using find method? Solution is explained below.
Assign value to virtual field before find function call:
$this->virtualFields[‘virtual_field_name’] = ‘any value’;
Use virtual field in find function:
$result = $this – > find(‘all’,
‘fields’ => array Read more…
While using Selenium Ide, It is very hard to verify the GUI and CSS elements using record and run method. In record and run method you will not be able to use all of the commands due to lack of commands in the web page context menu (Use Right click Read more…
1. Restful web service has its specific set of standard methods like: GET, POST, DELETE, PUT, OPTIONS. We should use HTTP methods as per standard. For example: use “Delete” method to delete the resource not for any other task.
2. We should return valid HTTP response code for each and Read more…
Description: I am trying to login in my Ubuntu machine. I entered my correct password and it didn’t login me. It showed me “failed to start session” message in red color. I am also not able to login with guest user.
Solution: This problem occurs Read more…
Queue plays very important role in Quickbook integration via Web connector. Each new job is created in the queue with priority level according to which it is executed. For example when we add a new user or new product than these events are stored in a queue as a job Read more…
By default, each cURL request can access only SSL certified websites. However, at times it is required to access those sites which are self-signed. To verify that your cURL request is able to access self-signed websites or not, use below command:
curl <URL of the domain to Read more…
Problem: How to access CLIENT_ID, CLIENT_SECRET in salesforce.
We can access the ClientID and ClientSecret by creating Connected app in Salesforce.
Solution: Follow these Steps to create a new app in salesforce.
1. Click on setup then under Build click on Create under create click on the App.
2. The Read more…
Suppose you want to design a custom scheduler in wordpress plugin instead of using wordpress scheduler which has fixed values of recurrence which are ‘hourly’, ‘twicedaily’,’daily’. And if you want to make the scheduler dynamic instead of making it static i.e. instead of setting the fixed scheduler value Read more…
Solution: You can add a newline character to formula field by using BR() function.
For Example: Formula Field value:
“Manager Schedule: Name, DOB, CDL #, Yrs Management Experience, Hire Date” & BR() & “Vehicle Schedule: Year, Make, Model, VIN, and radius for each vehicle” & BR() & Read more…
We have a custom object Survey and it has a status field with the values: New, Pending and Purchase. When Survey is in Pending status we want to send email to the user on every second day till the status changes.
Steps to do this task:
1. Create Read more…
Problem: How to format output text field value on VF page and also number formatting?
Description: In a situation I have date field on the vf page which is binded to date field having value in format “Thu Dec 1 07:00:11 GMT 2016”. But Read more…
Suppose we want to add a number of days to given date string. For this, it can be done as follows:
var givenDateString = “2016-10-10”;
var dateObj = new Date(givenDateString); // Converting date string to date Object to perform any date operations
var numberOfDaysToAdd = 2;
dateObj.setDate(dateObj.getDate()+ numberOfDaysToAdd Read more…
In struts.xml file of your web project, replace value for constant named “struts.action.extension” to as shown below :
<constant name = “struts.action.extension” value=”,”>
</constant> <!– we have set value for this constant to comma that means no extension as suffix Read more…
Problem: Task owner was not able to edit the task which is assigned to other user. I have a situation where a system admin assigns a standard user as an owner of the lead.
Like in my case Abc is system admin who assigns John as lead owner Read more…
Description: I have a situation where I want to fetch all the tasks related to the account object.
Solution: You get all the task records which belong to any of SF object using single SQL query.
For Single object:
For Example, I want to Read more…
Problem: After the first space in the string no data appears in the input field.
There is an issue when a string contains words with spaces and we want to display the whole string in an input field but after the first space, no data is displayed in Read more…
Merge Tags in gravity forms are the tags that are used to dynamically populate the field values in the form content in gravity forms like IP address, browser name, logged in user name etc . There are many merge tags available in the gravity forms by default.
But sometimes there may Read more…
Suppose the URL contains query string for example www.mywebsite.com/sme_page?q=12
then the value of query variable can be retrieved in PHP using the get method such as:
While creating a plugin for WordPress, to retrieve a value of query variables Read more…
You can create a dblink to a remote database in postgresql and query both local and remote together. Steps and an example below:
1. Enable dblink in postgresql
CREATE EXTENSION dblink;
2. Create connection with database server
SELECT dblink_connect(‘dbname=abc port=1234 host=abc user=abc password=abc’);
3 Read more…
Functionality needed : Once the datatable is completely loaded using ajax, I want to show second column only if role of the logged-in user is admin, else hide it.
What we need to do is, call API “initComplete” in datatable’s callback .
Do something like below :
$(‘#example Read more…