Skip to main content

Posts

Showing posts from 2017

Deep study on Salesforce count() vs count(fieldName)

Some useful links that related with count : COUNT() and COUNT(fieldName) Aggregate Functions Database.countQuery(query) "Count is used to discover the number of rows that a query returns. " You will notice , there two versions of syntax for COUNT(): count() count(fieldName) I experienced using both but I am not really deep into WHY COUNT() and WHY COUNT(fieldName) until today I did some reading and testing.I found the differences is quite interesting. Difference in Query Editor result : COUNT() No field return.It directly say Total Rows:17 COUNT(fieldName) Total Rows:1 and it returns field which 17. Difference in Apex code : COUNT() Can be assigned to Integer directly. Integer count =[SELECT COUNT() FROM Contact WHERE Account. Name Like ' Test% ' ]; system. debug ( ' count ' + count); COUNT(fieldName) You cannot assigned it to Integer or object, you must assign it to AggregateResult.It will throw error if you try to

Salesforce Certified Platform App Builder

On 4th Dec 2017 Malaysia time, I am officially certified as Salesforce Platform App Builder.Honestly I don't feel it easy due to tricky question. Topic Percentage Correct Security 83% Social 0% Data Modeling and Management 83% Salesforce Fundamentals 80% User Interface 50% Mobile 66% Reporting 66% App Deployment 80% Business Logic and Process Automation 56% Personally I believe working in Salesforce will not be enough if we have no idea how the questions will be asked in exam.Sometimes I get confuse with the sentences and easily fall into the trap.The feeling is like taking Science exam in Malay language and although I am Malay I still need to be careful with keyword and how tricky it could be. Once you plan to sit for exam, I highly advice you to check out how the question being asked.This can be done by check out the Exam Guide, quizes or mock up questions.Be careful on mockup question's answer because it might not 100% accurate.Usually I will read the quest

Google Analytic Overview

I spent some time to understand Google Analytic(GA) as I have some project that might require it. What is Google Analytic? Google Analytics  is a freemium web  analytics service offered by  Google  that tracks and reports website traffic.  Google  launched the service in November 2005 after acquiring Urchin.  Google Analytics  is now the most widely used web  analytics service on the Internet. Read more... Simply say, it use to track our website such page view etc. which enable us to see the performace of our website. There some pro and cons of using GA that has been mentioned in several sites.I just listed down what I want to know but I provide resource below so you can grab it for more info. Pro It's free so everyone can use it.We can setup up to 100 analytic account   . It's almost complete feature even for free version .It has has almost every metric we may want to analyze such bounce rate, average time spent on page, etc. It can be used in different enviroment

Label on InputField and OutputField is not working

Actually I faced this issue quite few times and  because I didn't take note on it  I keep forgetting and asking the same question again. Today, I got chance to do some testing to understand the behavior of apex:Inputfield and apex:outputField tag. Note that apex:inputField / apex:outputField is tied to the field's object which mean we cannot use it without sObject.I like it's Calendar widget for date field but because it does not have capability to support class property, I need to tie it with Standard/Custom object's date field. Here the example of usage public class TestClass { Date myDate { get ; set ;} //this will not work with <apex:inputfield value="{!myDate}" ... Opportunity opp { get ; set ;} //this will work on <apex:inputfield value="{!opp.CloseDate}" ... } Other thing that we need to take note is the label will work in apex:pageBlock and only if the apex:pageBlock in the proper structure. Checkout this code

My journey on converting Attachment to Files in Salesforce

Everyone know that soon Salesforce will remove related list of Attachment & Note in Page Layout( implementation expected in Winter'18 ). This is indicate that we should start using Salesforce Files that have better features especially for sharing. I started researching on this exercise somewhere in 2016 and I feel very grateful that I found a very good tool developed by Douglas C. Ayers.I have been testing the tool  in my organization and thanks to him because this app helps a lot of organization šŸ˜ƒ. I am writing here to share experience. I am happy to inform that we completed our conversion successfully.These are few steps that perhaps you find it useful.Bear in mind that this approach may not suitable for you.Please do some research before implementing it. Refresh UAT with the latest Production data , install the app and run a lot of testing till you gain confidence.We hit the  Content Publication Limits Exceeded which is annoying because we know our total Attachment is

Set Proxy for Force.com Migration Tool

When you  setup ANT and you believe it being setup correctly but still it still fail when you perform task, there are possibilities that your organization is using proxy.Example error that you receive when you run ant task. Caused by: com.sforce.ws.ConnectionException: Failed to send request to https:// test.salesforce.com/services/Soap/u/39.0  Here I list down of steps that I did to overcome this: Ask Network team what is the proxy host and port in your organization.Is username and password is required? Define proxy in target.In build.xml , create target name like below. <target name= "proxy" > <property name= "proxy.host" value= "xx.xx.xx.xx" /> <property name= "proxy.port" value= "xxxx" /> <!--If there username and password required <property name="proxy.user" value="UserName" /> <property name="proxy.pwd" value="

Winmerge give me misguide message.

I am using Winmerge to compare code. For some reason, it give keep saying that the files are different while I really confident that I haven't touch the file.When I open the file , there no difference visibly shown which give me a little headache. Turn out that I need to modify setting in Winmerge.Go to Edit, click on Options. Now the view is better.

Let it be...

Definition : The let statement declares a block scope local variable, optionally initializing it to a value. What different between var and let ? It is mathematical statement.Remember in Math class, our teacher always mention let , for example: If we let A be the statement "You are rich" and B be the statement "You are happy", then the negation of "A or B" becomes "Not A and Not B." The question already answered in : Why was the name 'let' chosen for block-scoped variable declarations in JavaScript? The different , notice the code below is using var, once you define same variable in local scope in second time , it will overwrite  the variable in global scope, function varTest() { var x = 1 ; if ( true ) { var x = 2 ; // same variable! console.log(x); // 2 } console.log(x); // 2 } Using let, help to identify which belong to which. function letTest() { let x = 1 ; if ( true ) {