Get last n digits from a String using Apex in Salesforce
right()
is used to get last n digits from a String using Apex.
Here is an example:
String str = 'biswajeet'; String result = str.right(4); //returns jeet
right()
is used to get last n digits from a String using Apex.
Here is an example:
String str = 'biswajeet'; String result = str.right(4); //returns jeet
toLabel()
is used to convert the results of a field into user’s language.toLabel()
can convert the results into user’s language, if the translation workbench is enabled.toLabel()
.toLabel()
function in SOQL.Here is an example:
SELECT Name, toLabel(Industry) FROM Account
Result:
Sometimes we need “NOT LIKE” operator in SOQL.
But SOQL will not allow someone to write simple query using “Not Like” operator such as:
SELECT Name From Account Where Name Not Like '%Test%';
So, here is the solution:
SELECT Name From Account Where Not Name Like '%Test%';
If you are using “GROUP By” clause with “Not Like” operator, here is an example:
SELECT Name From Account Where Not Name Like '%Test%' Group By Name;
Standard Object:
Go to Setup – App Setup – Customize – Standard Object – Fields – Picklist or Multi-select Picklist Field
Custom Object:
Go to Setup – App Setup – Create – Object – Fields – Picklist or Multi-select Picklist Field
Salesforce lookup auto complete is a simple feature, which help a lot for daily works, but many of us may not aware about this feature. In this article, I will demonstrate how enable auto complete feature.
Steps to enable Lookup Auto Complete feature.
Step 1:
Go to Setup | App Setup | Customize | Search | Search Settings.
Step 2:
Scroll down to Lookup Settings and look for objects that you need enable for auto-completion then check Lookup Auto-Completion for the objects. Here in below snapshot I’ve enable lookup auto-complete for Account object.
Here is a snapshot of contact entry page, before enable lookup auto completion for Account object, when user type in Account name field, nothing show up. Here Contact is the child object of Account parent object.
After enable lookup auto completion in Account object, when user type a character in Account name field, it will show recent record from parent object Account.
Note: