Page Redirection on the basis of Record Type/Field (Classic) I came across an requirement where I have redirect user to different pages on the basis of Record Type (redirection is possible on the basis of fieldvalue as well). Lets take an example Object : Account Record Types : Customer [opens in Standard detail page] Partner [opens in Visualforce page] when user try to access account record of type 'Customer' then Salesforce standard page should get open but accessing any account of type 'Partner', custom visualforce page should be open. Controlling page-layout on the basis of record type is possible but we cannot open visualforce page on the basis of record type or field value. To achieve this functionality we have write some code and need to override standard view button. To achieve this requirement we will create a visualforce page and apex class. after creating page and controller now its time to override Account's View...
Posts
Showing posts from 2018
- Get link
- X
- Other Apps
By
Puneet Mishra
-
Improve SOQL Performance SOQL (Salesforce Object Query Language) used to search Salesforce data for specific information. SOQL allows us to specify source object, a list of fields to retrieve and condition for selecting rows in source object. SOQL returns List<Sobject> To avoid long execution time, non-selective SOQL queries may be terminated by the system to improve the performance. A query is selective when one of the query filters is on an indexed field and query filter reduces the resulting number of rows below a system-defined threshold. The performance of the SOQL query improves when two or more filters used in the WHERE clause meet the mentioned conditions. Following fields are indexed by default and when used in SOQL WHERE clause improved the permormance. Primary Key (Id, Name and Owner fields) Foreign Keys ( lookup or master-detail relationship fields). Audit dates ( systemModStamp). Custom fields marked as External ID or Unique. NOTE: ...
- Get link
- X
- Other Apps
By
Puneet Mishra
-
Difference between query()/ QueryMore()/ QueryAll() query(): it executes a query against the specific object and returns data that matches the specific criteria. Syntax: QueryResult = connection.query(string queryString); used in SOAP API, when a client application invokes the query() call, it passes a query string that specifies the object to query, fields to retrieve, and any condition that records need to satisfied. Client application must be logged in with sufficient access rights to query individual objects and specified fields. The query result object contains upto 500 rows of data by default. If the query results exceed 500 rows, then client application uses the queryMore() call and a server-side cursor to retrieve additional rows in 500-row chunks. queryMore(): Use this call to process query() calls that retrieve a large number of records( by default, more than 500) in the result set. The query() call retrieves the first 500 recor...