• About
  • Contact me!

Salesforce Everywhere

~ Blog on Salesforce Dev and admin stuff

Salesforce Everywhere

Category Archives: Uncategorized

Tip# 23 – Why this error message System.QueryException: Non-selective query against large object type?

30 Sunday Jul 2017

Posted by Mani in Uncategorized

≈ Leave a comment

Recently, in the project that I am working on, we have received this error in our apex code and this error occurs when querying large objects using SOQL (particularly for queries inside triggers). In our case, SOQL is inside the TriggerHandler which is called by the trigger.

Developers receive this error message when a non-selective query in a trigger executes against an object that contains more than 200,000 records. To avoid this error, ensure that the query is selective.

The performance of a SOQL will depend on the presence of a selective filter(in WHERE Clause). If a SOQL query contains at least 1 selective filter, the query is said to be selective. If the SOQL query doesn’t contain a selective filter, the query is said to be un-selective and will require a full table scan.

How to determine if the query is selective?

  • A query is selective when one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold.
  • The selectivity threshold is 10% of the first million records and less than 5% of the records after the first million records, up to a maximum of 333,333 records.

Example:

  1. SELECT Id FROM Account WHERE Id IN (<list of account IDs>)

Since the filter is on the ID field which is a standard and Primary Key field, it will have an index created at the DB. If SELECT COUNT() FROM Account WHERE Id IN (<list of account IDs>)returns fewer records than the selectivity threshold, the index on Id is used. This index is typically used when the list of IDs contains only a few records.

2. SELECT Id FROM Account WHERE Name != ”

Since Account is a large object even though Name is indexed (primary key), this filter returns most of the records, making the query non-selective.

3. SELECT Id FROM Account WHERE Name != ” AND CustomField__c = ‘ValueA’
Here we have to see if each filter, when considered individually, is selective. As we saw in the previous example, the first filter isn’t selective. So, let’s focus on the second one. If the count of records returned by SELECT COUNT() FROM Account WHERE CustomField__c = ‘ValueA’ is lower than the selectivity threshold, and CustomField__c is indexed, the query is selective.

For more information:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_VLSQ.htm

https://help.salesforce.com/articleView?id=000002493&type=1

Also, there are lot of links in stack exchange which discusses this issue and you can refer them as needed: https://salesforce.stackexchange.com/search?q=Non-selective+query

 

 

Salesforce Certified Administrator – Summer ’17 Release Exam

20 Thursday Jul 2017

Posted by Mani in Uncategorized

≈ 17 Comments

1 of 5. Which two features best describe the new Lightning-optimized Log a Call
action?
Choose 2 answers
A. Autolink the Call Log to the Case
B. Autolink the Audit Log to the Case
C. Autopopulate the Case Contact
D. Autopopulate the Case Team

Ans: A & C

2 of 5. How can an administrator allow users to choose different views of a
dashboard in Lightning Experience?
A. Dashboard filters
B. Dashboard designer
C. Report filters
D. Report creator

Ans: A

3 of 5. Where are the files and related records attached when a sales user converts a lead?
A. Contact, account, person account, opportunity records
B. Contact, account, opportunity, quote records
C. Contact, account, opportunity records
D. Contact, account, person account records

Ans: A

4 of 5. What action can be taken in Lightning, if you receive an approval request
that someone else should approve?
A. Delete the associated record
B. Change Approval Entry Criteria
C. Edit Approval Process Manager
D. Re-assign the approval request

Ans: D

5 of 5. Which two Chatter Groups will show a seen-by count of people who viewed the post, in the Lightning Experience?

Choose 2 answers
A. Restricted
B. Private
C. Unlisted
D. Public

Ans: B & C

Salesforce Certified Platform App Builder – Transition Exam

08 Saturday Jul 2017

Posted by Mani in Uncategorized

≈ 17 Comments

Hi All,

I have cleared my Salesforce Certified Platform App Builder – Transition Exam (SP17) today and here are the tips from my side to clear the exam:

  1. Go through the training resources given in “SECTION 4. RECOMMENDED TRAINING AND REFERENCES” in the exam guide available at https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjjtYTppPnUAhXFx7wKHdhqCMQQFggoMAA&url=http%3A%2F%2Fcertification.salesforce.com%2FSG_CertifiedPlatformAppBuilderTransition.pdf&usg=AFQjCNGl2oWzGI-d9lbhQZlCfiFBZtmGFw
  2. Go through the questions given in https://www.proprofs.com/quiz-school/story.php?title=transition-app-builder. You may have doubts in answers for some of the questions, you can post them here and I will give my answer accordingly.
  3. Also, go through “Platform App Builder – Full Question Set” as given in http://sfdcstudy.org/platform-app-builder-quizzes/

I got almost 90% of the questions in my exam from the above links, so this would suffice mostly, unless you are not lucky:)

Please let me know for any questions.

Debugging flow trigger error

01 Thursday Jun 2017

Posted by Mani in Process Builder, Uncategorized

≈ 2 Comments

Tags

Flow trigger error, process builder error

Yesterday morning, one of the batch in my company failed with the following error and I had to debug:

The record couldn’t be saved because it failed to trigger a flow.
A flow trigger failed to execute the flow with version ID 200L0000000DApf”

I knew that we do not have any Visual flows hence it should be one of the processes in the process builder failed, but how do I find out the name of the process which has failed?

One of the easiest option is to take the version ID as mentioned above(200L0000000DApf) and go to https://workbench.developerforce.com->Info > Metadata Types & Components.  Click ‘Expand All’ and Search for the ID(200L0000000DApf). You will know the name of the process which has failed and if you want to know in which step it has failed, obviously put a debug log and simulate the scenario to get the error. Then, you can check the log for more information.

Let me know for any questions. Thanks!

Tip# 22 – Rowsperpage

01 Saturday Apr 2017

Posted by Mani in Salesforce Configuration, Uncategorized

≈ Leave a comment

Tags

changeset

Many of us would know this tip, but I thought of sharing it as it will be useful for someone who does not know about it.

Suppose you want to add a field “Available To” from the Product object on to the changeset, so you would click on Add button, select Custom field in the drop down and click on A. Then you would click on next page and select the field “Available To” .

Instead, you can click on more records per list page and go to end of the address to look for “rowsperpage”:

Rowsperpage

Change it to lets say 2000 and click on enter, in this way, you don’t need to navigate to next page to select the field:

Rowsperpage-LATER

Let me know for any questions.

 

Tip#21 – ColumnCopy

18 Saturday Mar 2017

Posted by Mani in Uncategorized

≈ Leave a comment

Apologies, have been busy with work and personal stuff hence could not write posts for a long time and I am back:)

Suppose you want to copy all the fields in an object and put them on to excel, you can use the following chrome extension:

https://chrome.google.com/webstore/detail/columncopy/lapbbfoohlcmlbdaakldmmallcbcbpjb?hl=en

Example:

Suppose, you want to copy all the custom fields from Order object, you can follow the below steps to do so:

  1. Go to Setup -> Orders -> Fields
  2. Navigate to see Order Custom Fields & Relationships section
  3. Right click and select Copy entire table from ColumnCopy option. It will highlight the table that is getting copied, once you select this option.

Columncopy

4. Then open excel and paste

Excel

Hope this tip will be useful!

P.S: you have an option to only the column too by selecting Copy this column option.

 

Code Indentation

20 Monday Jun 2016

Posted by Mani in Uncategorized

≈ Leave a comment

Tags

code indentation

I have been working in Batch apex and there was always a need to indent the code for readability and understandability.

I have used the following link for indenting the code:

http://courses.cs.washington.edu/courses/cse341/10au/indent.html

Hope you can also use it for code indentation!

Issue: Duplicate (blank) versions are created when deploying a Flow with Change Set

24 Tuesday May 2016

Posted by Mani in Known issues, Uncategorized

≈ Leave a comment

Tags

duplicate version in flow

I tried deploying the flow to Production org using Change Set and the flow was modified in my Sandbox Org. After deployment, Salesforce created 2 versions of the flow in Production org and one was blank. When I searched in google, I found out that this is one of the known issue. Here are the details and you can subscribe to this link, if this issue affects you so that you will be notified by Salesforce when the issue is resolved. Thanks!

Tip#20 -Restricted Picklists

22 Sunday May 2016

Posted by Mani in Salesforce Configuration, Uncategorized

≈ Leave a comment

Tags

data integrity, restricted pikclists

A restricted picklist field includes only the values that you’ve defined and users cannot enter any value other than the defined picklist values. This is to ensure that the integrity of the picklist data is maintained and your picklist stays clean. Salesforce has introduced this functionality in Spring’16 and it is in Beta.

If you have a Developer Edition org or sandbox org, no setup is required to use restricted picklists. For all other editions, restricted picklists are available as a beta feature, which means they’re highly functional but have known limitations. Contact Salesforce to enable restricted picklists.

Suppose, you have configured a restricted picklist in Sandbox and when you move it to production, you might get an error “Cannot have restricted picklists in this organization.” To resolve the issue, you can contact support to enable restricted picklists in production org.

Here you can find the release notes from Salesforce.

Salesforce Ideas implemented in Summer’16 release

17 Tuesday May 2016

Posted by Mani in Salesforce releases, Uncategorized

≈ Leave a comment

Tags

Summer 16

I have gone through this article and excited about the features released as part of Summer’16 release , so thought of sharing it. Thanks!

← Older posts
Newer posts →

Blog Stats

  • 111,809 hits

Archives

Recent Posts: Salesforce Everywhere

How to get field values on onLoad in lightning-record-edit-form in LWC?

Using Dynamic Actions

How to check if the logged in user is a Guest user or not in APEX class?

How to Close Quick action in LWC

Lightning component to filter Products and display results in lightning data table

Connect with me

  • View @manibalan_s’s profile on Twitter
  • LinkedIn

Developer links

  • Salesforce Developer website
  • Salesforce Success Community

Enter your email address and click on Follow us (below) to follow this blog and receive notifications of new posts by email.

Website Powered by WordPress.com.

  • Follow Following
    • Salesforce Everywhere
    • Already have a WordPress.com account? Log in now.
    • Salesforce Everywhere
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar