Andy in the Cloud

From BBC Basic to Force.com and beyond…

About

I started this blog to share some thoughts, ideas and opinions around my main passion in life computing, or more specifically these days Cloud computing. Who knows maybe I’ll go stray now and again into some of my others as well!

I am currently working for Salesforce.com in Product Management for the Platform. Previously FinancialForce.com CTO. Enjoying working and at times coding hard with everyone to make this new startup company a raging success! Along with our friends at Salesforce.com and UNIT4. I am pleased to have been selected as a Force.com MVP!

I am a Salesforce MVP. For more information on the Salesforce MVP community, visit: http://www.salesforce.com/mvp/. Salesforce, Force, Force.com, Chatter, and others are trademarks of salesforce.com, inc. and are used here with permission.

Any views expressed on this blog are entirely my own.

forcedotcom-mvp

277 thoughts on “About

  1. Salesforce is doing a Critical Update for Winter 21 Release:

    We want to take this opportunity to remind you that we are enforcing the ‘Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users’ and the ‘Restrict Access to @AuraEnabled Apex Methods for Authenticated Users Based on User Profile’ Release Updates in the Winter ‘21 release.

    Does your installed package have @Auraenabled Classes that i would need to add to profiles?

  2. Hello Andrew,

    I am having an issue with DLRS. I posted on the community chatter group but I did not receive any responses yet. The issue is as under. Can you please help. Thanks a lot.

    I created a Roll up summary to count the number of contact roles on an Opportunity using DLRS. [Parent: Opportunity, Child: OpportunityContactrole, Relationship field: OpportunityId, FieldtoAggtregate: ID]

    I selected the calculation more as scheduled and it calculated the values correctly.But now when I add a new contact role to opportunity it gives me the following error

    dlrs_OpportunityContactRoleTrigger : dlrs_OpportunityContactRoleTrigger: execution of AfterInsert caused by: System.QueryException: Grouped field should not be aggregated: OpportunityId Class.dlrs.LREngine.QueryExecutor.query: line 662, column 1 Class.dlrs.LREngine.WithSharingQueryExecutor.query: line 671, column 1 Class.dlrs.LREngine.rollUp: line 238, column 1 Class.dlrs.LREngine.rollUp: line 117, column 1 Class.dlrs.RollupService.updateMasterRollupsTrigger: line 1035, column 1 Class.dlrs.RollupService.handleRollups: line 919, column 1 Class.dlrs.RollupService.triggerHandler: line 311, column 1 Trigger.dlrs_OpportunityContactRoleTrigger: line 7, column 1

    • It should not be running the query realtime for Schedule mode – have you perhaps got another rollup definition lurking somewhere else?

  3. Hi Andrew,

    Many thanks for this tool (though in all honesty, thanks is too small a word to describe my gratitude).
    I recently modified the relationship criteria of an existing rollup to add an OR condition.
    When I run a full calculate on this revised rollup the batch completes successfully, but doesn’t pickup any records, so its like a false positive.
    Can you please advise why this could be happening

    Regards

    • For full calculate you need to put your criteria in on the screen when you press the button. The criteria on the rollup definition is not used for full schedule rollups.

  4. I created some DLRS while I was in Classic, but I can’t see or edit them in Lightning. Do I need to delete them and re-create them in Lightning?

    • No they will exist – the Lightning App however does not by default show the “Declarative Rollup Summary” tab – you will need to add this to your profile or a permission set assigned to your user. Then search for the tab in the laucher or add the tab to the rollup app.

  5. Hi Andrew,
    We have created many DLRS fields to update data for lookup relationships. These are defined as real-time. However when the “child” record is created or edited the fields on the “parent” object are not consistently updated. Any insight you can provide would be greatly appreciated since the data is critical to the proper flow of a major upgrade to out current applications.

    • Rollups are calculated on insert and delete of a child record – when updating a child – only field changes to fields referenced on the rollup definition are monitored. Check “Relationship Fields” field.

  6. Pingback: Awesome Salesforce – Massive Collection of Resources – You Ever Wondered To Get – Learn Practice & Share

  7. Hello Andrew, Salesforce has released new updates which impact the existing components of managed packages. As c3HealthcareRX is using Declarative Lookup Rollup Summaries Tool which is a managed package, there may be impact on the components used. Please could you confirm is there any impact on functionality if we activate the critical updates ?
    https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_lc_secure_static_resources_update.htm
    https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_flow_mgmnt_access_legacy_actions_cruc.htm
    https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_lc_apex_methods_packages_cruc.htm
    https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_lc_enforce_prop_modifiers_cruc.htm

  8. Hi Andrew. We have been using DLRS for a while now and it’s been working fantastically. Until a week or so ago. I have recently had to edit all of our US and Canada State/Country Integration values. Previously they were, for example, United States. I recently changed them to match ISO coding, i.e US.

    Since making these changes, some records are not able to be saved, giving me error messages such as: “There’s a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.”
    Or
    Mismatched integration value and ISO code for field

    After chatting with the Salesforce Support team, and doing some of my own digging, it seems that the DLRS_AccountTrigger, ContactTrigger, and Opportunity Trigger apex triggers are causing the problem. Disabling them in my sandbox solves the issue.

    I’m wondering, why would those DLRS triggers be interfering with my state/country integration values? Have you come across this? And if so, is there a workaround?

    Thanks so much.

    Max

    • My guess is it could be one of the rollup rules is rolling up a field with an old country picklist value in it maybe? Go through your rollup rules for these objects and see if thats the case. And if you have any old records with picklist values that are no longer valid. And also does it still fail for brand new records?

  9. Hello Andy,

    I’m hoping you can help with an issue that SF Support is troubleshooting for us at Guiding Eyes for the Blind. The issue has been sent to tier 3 and they have sent this request –

    The error that is thrown in the flow in coming from the apex classes that are part of the managed package.

    The managed package: ” Declarative Lookup Rollup Summaries Tool (Managed)”.

    If you are not the vendor of the managed package please get written consent from the vendor the managed package to enable the debug logs in order to find out the point of the error.

    Are you the correct person to give this permission or can you tell me who is. Thanks in advance for your help.

    Judi

    • I am a key originating author of this tool yes. However it is reallly supported by a great community and when i can myself. Please check out the readme file in the tools github repo for a link to the chatter community group.

  10. I am trying to schedule DLRS apex job Rollup summaries and keep getting the error “Error: You must select an Apex class that has a parameterless constructor” I have not deleted the old schedule that is under an Admin ID. please advise.

    • You have to use the Schedule button on your rollup definition if this is a full recalc you want. The other way is the incremental reschedule path. Check out the wiki on the repo for a great article that covers the differences.

  11. Issue: When changing the status of any opportunity everyone gets an error:

    Error:Apex trigger dlrs_OpportunityTrigger caused an unexpected exception, contact your administrator: dlrs_OpportunityTrigger: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Class.dlrs.LREngine.rollUp: line 210, column 1

    ============
    Debug logs analysis shows that the error is occuring due to a non selective query from the Managed package code:

    11:13:55.1 (320966640)|ENTERING_MANAGED_PKG|dlrs
    11:13:55.1 (322368972)|SOQL_EXECUTE_BEGIN|[210]|Aggregations:0|SELECT CampaignId, Sum(Marge_2016__c) lre0 FROM Opportunity WHERE CampaignId in :masterIds AND IsWon = true GROUP BY CampaignId
    11:13:58.55 (3055899789)|METHOD_EXIT|[7]|01p24000007K7Dz|dlrs.RollupService.triggerHandler()
    11:13:58.55 (3056161207)|FATAL_ERROR|System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
    Even if a field is indexed a filter might still not be selective when:
    1. The filter value includes null (for instance binding with a list that contains null)
    2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

    Class.dlrs.LREngine.rollUp: line 210, column 1
    Class.dlrs.LREngine.rollUp: line 105, column 1
    Class.dlrs.RollupService.updateMasterRollupsTrigger: line 580, column 1
    Class.dlrs.RollupService.triggerHandler: line 318, column 1
    Trigger.dlrs_OpportunityTrigger: line 7, column 1

    =========

    Query causing the issue: SELECT CampaignId, Sum(Marge_2016__c) lre0 FROM Opportunity WHERE CampaignId in :masterIds AND IsWon = true GROUP BY CampaignId

    ============

    Resolution: The query needs to be optimized to make it selective. This should be looked into by the managed package provider.

    Salesforce supports custom indexes except for multi-select picklists, text areas (long), text areas (rich), non-deterministic formula fields, and encrypted text fields.

    “IsWon” is a non-deterministic formula field hence an index can’t be created.

    • Yes unfortunately the tool is still subject to these kind of limits per the readme file. Take a look at the scheduling modes wiki page – maybe you need to flip to partial or full scheduled recalcs – likely full. Also it looks then like this parent has lot of children, normally Salesforce recommend max of 10k. The other thing is if your updating a lot of Campaigns (child records at once) then maybe you can flip to the incremental scheduled mode and reduce the scope size (via the tools custom setting). Finally another option is maybe to constrain things further by a date and/or perhaps have an actually Boolean field for isWon for records and update that via a trigger or flow. You would then of course have to get such a field updated for all your historic records keep in mind. So hopefully a few ideas among this response for you. In the end the tool is working within the limitations of the platform unfortunately. Oh and finally have you tried the community chatter group for the tool see what thoughts others have? That is linked on the readme for the tools. Good luck and take care! 👍🏻

  12. Hi, Andy,
    Big fan of Lightning File Explorer. Trying to install the unmanaged code so I can make a couple of changes, but our developer hit a problem he describes here:
    “the package conflicts with an SF critical update from August 2020 – You can now only initiate Apex classes that have a no-arguments constructor that is visible to the code running Type.newInstance. This will result in the code needing to be rewritten, even if we can successfully get it deployed.”

    Is there any chance there is updated code out there that overcomes this?

    One of the reasons I need to make changes is that I’m using Communities, and need the ability to have guest users upload files. But I can’t add guest users to the Permission Set, so every file upload fails.
    Any ideas on how to get past this?
    Thanks again for a great app!
    Chris

    • Hello – thanks for posting – unfortunately I am not the owner of that tool – have you got the correct site?

  13. Hello Andrew, two weeks ago I left a comment on this site about a problem we are experiencing with a package you created. I didn’t see a reply of you yet, is that correct. Can you please take a look at the message. For your convenience, I’ll paste it again below this message.

    —–

    Issue: When changing the status of any opportunity everyone gets an error:

    Error:Apex trigger dlrs_OpportunityTrigger caused an unexpected exception, contact your administrator: dlrs_OpportunityTrigger: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Class.dlrs.LREngine.rollUp: line 210, column 1

    ============
    Debug logs analysis shows that the error is occuring due to a non selective query from the Managed package code:

    11:13:55.1 (320966640)|ENTERING_MANAGED_PKG|dlrs
    11:13:55.1 (322368972)|SOQL_EXECUTE_BEGIN|[210]|Aggregations:0|SELECT CampaignId, Sum(Marge_2016__c) lre0 FROM Opportunity WHERE CampaignId in :masterIds AND IsWon = true GROUP BY CampaignId
    11:13:58.55 (3055899789)|METHOD_EXIT|[7]|01p24000007K7Dz|dlrs.RollupService.triggerHandler()
    11:13:58.55 (3056161207)|FATAL_ERROR|System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
    Even if a field is indexed a filter might still not be selective when:
    1. The filter value includes null (for instance binding with a list that contains null)
    2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

    Class.dlrs.LREngine.rollUp: line 210, column 1
    Class.dlrs.LREngine.rollUp: line 105, column 1
    Class.dlrs.RollupService.updateMasterRollupsTrigger: line 580, column 1
    Class.dlrs.RollupService.triggerHandler: line 318, column 1
    Trigger.dlrs_OpportunityTrigger: line 7, column 1

    =========

    Query causing the issue: SELECT CampaignId, Sum(Marge_2016__c) lre0 FROM Opportunity WHERE CampaignId in :masterIds AND IsWon = true GROUP BY CampaignId

    ============

    Resolution: The query needs to be optimized to make it selective. This should be looked into by the managed package provider.

    Salesforce supports custom indexes except for multi-select picklists, text areas (long), text areas (rich), non-deterministic formula fields, and encrypted text fields.

    “IsWon” is a non-deterministic formula field hence an index can’t be created.

    You may refer the below mentioned article:
    https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_infrastructure_indexes.htm#:~:text=Salesforce%20also%20supports%20custom%20indexes,optimizer%20then%20considers%20those%20fields.

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

    • Sorry for the late reply – my life is quite busy and I don’t get to respond as often as I would like – I am sorry. The good news is I believe I did just respond to your last message with some thoughts. 👍🏻

  14. Are you available to help with errors I am getting from the DLRS – is there a help area you offer?

  15. Is there an issue with the Deploy To Salesforce Tool? I keep getting the following error when I click the “Login to Salesforce” button

    Application error
    An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

  16. Hi Andrew,

    Is there any possibility to collaborate with your blog via guest post? Do you accept this kind of contribution?

    I would be happy to receive your reply!

    Stay safe,
    Roksi

  17. Hey Andrew. I’ve been having a BOG of a time trying to get the Metadata API working in a v51 org. Things I’ve tried:

    – FinancialForce class from github: “Web service callout failed: Unable to find apex schema info”
    – Metadata WSDL from org -> APEX Class: “Web service callout failed: Unable to find apex schema info”
    – Switching the version of API Version on various classes from 51 down to 47. Nothing helps.
    – Modify the class a bit to address error: I don’t think I know enough about SOAP. I thought I got close but there were constant errors about there not being a class for various elements like fullName, deprecated, etc.
    – Search internetz: The internet is of no help either which is weird.
    – Ask developer friends: None of my developer contacts have any idea what is going on. They all refer me to the github repo.

    I did notice fundamental difference between the class from the FF git and the generated class. In the FF class, all things extend Metadata. In generated class, all things do NOT extend Metadata. And the Port classes are super different. The FF class has a whole interface structure to handle dynamic return results.

    Either way, I’d really like to get a correct class going so I can move on to building but alas, I am stuck.

    Any help would be amazing.

    • Yes the FF is modified to support the Metadata SOAP API – the one generated by default does not work. It looks like the FF one needs updating to support v51 orgs. Its odd though because it should be backwards compatible (as the underlying Metadata SOAP API is as well). What operation are you performing and is it with the FinancialForce MetadataService.cls straight from the repo?

  18. Hi,

    I have run into a problem with DLRS. A Guest user (Guest License) is not adding rollup entries, and thus nothing is being calculated (scheduled). Other users are perfectly filling rollup entries (for same object/rollups), but somehow not this Guest user. I suspect it is something with autorisation, the Guest user having no autorisation to add rollup entries to DLRS objects (scheduled items). I have looked everywhere, tried a lot of things but for now to no avail.

    Do you have a pointer for me?

    Brgds, Max

    • Hi Max, it might be that you need to use the System Mode setting on your rollup here. Also please see the link to the community chatter group for further support – https://github.com/afawcett/declarative-lookup-rollup-summaries#community-support

    • Yes it could be – have you tried granting the roll up permission set included in the package to the guest user? This includes these objects. Also try generating some debug logs to see if any errors occur. Finally there is excellent community support – those that may have seen this issue – you can click the link in the GitHub readme file and it will take you to the chatter community page. Hope this jelps

  19. Hello Andrew Fawcett,
    We are using your declarative lookup rollup summaries package, it is a great tool, we have been using it from version 2.11, but now, we are facing an issue that some License Records are not updating with the correct number of licenses assigned. We have done some investigation and found out the problem as below:

    Error:Upsert failed. First exception on row 0 with id a1H0o00000SN4iJEAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, dlrs_sfLma_LicenseTrigger: execution of AfterUpdate

    caused by: System.DmlException: Update failed. First exception on row 0 with id 0010o00002mzRH0AAM; first error: UNKNOWN_EXCEPTION, Failed to publish events: []

    Class.dlrs.RollupService.Updater.updateRecords: line 1315, column 1Class.dlrs.RollupService.UpdateWithoutSharing.updateRecords: line 1358, column 1Class.dlrs.RollupService.updateRecords: line 1286, column 1Class.dlrs.RollupService.handleRollups: line 892, column 1Class.dlrs.RollupService.triggerHandler: line 329, column 1

    We tried to upgraded the package to the latest version 2.13, but it looks like this problem still existing. Could you please help to review and advice.

    Your help is appreciated and we are looking forward to hearing from you.

    Thanks and best regards,
    Phuong

    • Sorry I am not sure – “Failed to publish events” is not an error generated by the tool. I wonder if it comes from the trigger sfLma_LicenseTrigger?

  20. Hi Andy. I am new to my company and I see we are using your product Declarative Lookup Rollup Summaries Tool. I get Apex Application error messages every day that reference the summaries this tool is running, for example: “A calculate job for rollup ‘Num Active Summit Assets’ is already executing. If you suspect it is not aleady running try clearing the applicable record from the Lookup Rollup Calculate…” I’m trying to find out why we’re getting these messages and if they’re something I need to worry about? It almost seems like the summaries are maybe schedule too closely together or one isn’t completing before another one starts or something. If there is any kind of assistance or support you can offer regarding these I would appreciate it. Thanks!

    • That’s a likely reason – check out the tab for inspecting these errors on the app itself. Clear the records if you believe no job is running and yeah check if the jobs are overlapping. Also checkout the community chatter group linked on the readme file

Leave a Reply to Jeff Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s