Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 18731

Accounts are your organization’s customers, competitors, and partners. Each account stores information such as name, address, and phone numbers. For each account, you can store related information such as opportunities, activities, cases, partners, contracts, and notes.

3 votes
Accepted

Get 10+ Level Hierarchy Relationship

This may fail due to soql 101 error for the so many level of account hierarchy public id accId{get;set;} public String ids; public childs() { //pass first account record Id fetchParentRecord … (accId); } //this method will iterate untill the parent Id is null private void fetchParentRecord(Id recordId) { //each time query on Account and get the get the parent Id List<Account> lstAccount …
Ratan Paul's user avatar
  • 22.8k
4 votes
Accepted

how to check if an account has more than 100 cases

You can try like this. use HAVING clause with aggregate query with group by AccountId SELECT count(Id) , AccountId FROM Case GROUP BY AccountId HAVING count(Id) > 100 you will get all the accoun …
Ratan Paul's user avatar
  • 22.8k
5 votes
Accepted

System.QueryException: No such column 'BillingStateCode' on entity 'Account'

If you are getting this error in apex class then I suggest you to update the API Version of your class. You will get this error if your Apex Class version is less than 27. Update the API version to …
Ratan Paul's user avatar
  • 22.8k
1 vote

Populate Account on Opportunity using externalID in before insert Trigger

First you need to query Account based on external Id i.e. 12321 trigger ExternalIdTrigger on Opportunity (before insert, before update) { List<Account> lstAccount = [SELECT Id FROM Account WHERE ID …
Ratan Paul's user avatar
  • 22.8k
6 votes
Accepted

Assign account to Territory Rule in apex code

Use this class TerritoryMangRule.fireTerritoryManagementViaSoap(Pass list of Account here). … ac:lstAccountToUpdate) { sobjectPartnerSoapSforceCom.sObject_x tmpObj = new sobjectPartnerSoapSforceCom.sObject_x(); tmpObj.type_x = 'Account'; tmpObj.Id = …
Ratan Paul's user avatar
  • 22.8k
2 votes
Accepted

Use Like in a single SOQL query

You can do like this way Create set of string %Name1%, %Name2%etc List<String> lstString = new List<String>{`%Name1%`, `%Name2%`, `%Name3%`}; List<Account> accList = [Select Name from Account where Name … LIKE: lstString ]; Updates List<String> lstString = new List<String>{'%Intel%', '%HP%', '%Dell%' , '%IBM%'}; for(Account obj : [Select Name from Account where Name LIKE: lstString ]){ system.debug …
Ratan Paul's user avatar
  • 22.8k