Usages of ID class in Salesforce

Author Archives: Lin

Usages of ID class in Salesforce

As we know that each record Id represents a unique sObject record. There are two versions of every record Id in salesforce : ・15 digit case-sensitive version which is referenced in the UI ・18 digit case-insensitive version which is referenced through the API And there are many usages of sObject ID,such as:Get the sObject name […]

read more

Calculate the difference between two DateTimes in Salesforce

In Formula Calculate the second difference between two DateTimes. In Visualforce Page Calculate the second difference between two DateTimes. In Apex ※A “Date/time arithmetic expressions must use Integer, Decimal or Double arguments” error will be occurred, when we subtract between two DateTimes directly like Formula.

read more

Synchronize data between Postgres and Salesforce via Heroku Connect

Somtimes we need to built a Web App with standard open source stacks, like PHP, Node.js and Python,but manage and analytic data with Salesforce standard functions,like record CRUD,views and reports. Heroku Connect provides us a pretty simple solution for this case, that using bi-directional synchronization between Salesforce and Heroku Postgres,whatever standard objects or custom objects. […]

read more

Save approver automatically in Approval Processes with Process Builder and Flows

In previous post,I shared how to 《Create Roll-Up Summary field to count Contacts on Account with Process Builder and Flows》. In this post I will share about how to save approver(current user) to the target object automatically in Approval Processes, with Process Builder and Flows. Actually,this is another interesting usages of Process and Visual Flows. […]

read more

Line break character may be escaped by JS in VF Page

The line break character may be changed, if it is sent from Visualforce Page with Ajax(Such as apex:commandLink and apex:actionfunction). Let me show you a sample first. Sample Code Visualforce Page Apex Class Results Click [Compare By Submit] button, and the compare result is “true”. Then click [Compare By Ajax] link,we will find the compare […]

read more

Two ways to use SOQL IN clause

With binding set of Ids We can have a simple SOQL statement like this: Or direct from keySet of Map With binding list of sObjects Actually,There has another way to use IN clause like this: Enjoy it!

read more

Write a Heroku Scheduler batch for MangoDB+Salesforce with Node.js

In previous post,I had shared how to 《Access Salesforce data via APIs(JSForce) from Outside Service》. In this post I will share about how to write a Heroku Scheduler batch for synchronizing MangoDB data to Salesforce with Node.js, like the below outline picture. ※I have no doubt that there have many ways to do connect between […]

read more

Write Apex Test Classes efficiently with Tesforce

1.Why Tesforce The Test Classes are required to deploy Apex to a production environment or to be packaged and placed on Force.com AppExchange, it must provide at least 75% code coverage. That will be a huge workload to SFDC Developers if the project(application) include a lot of Apex Classes,the cost of time to write Test […]

read more

Salesforce ContentDocument sObject in Apex Unit Tests

ContentDocument object does not allow insert DML operation in Salesforce, but we can create it through the ContentVersion object, without ContentDocumentId, then a new version of ContentDocument will be created for us in SFDC, just like the sample code below :

read more