• Michelle Grant
  • NEWBIE
  • 15 Points
  • Member since 2014
  • Salesforce Administrator
  • Tripwire

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
This is not a how to question, but a best practice/opinion question. I have a request to update a calculation on specific child records when a field on a parent record is updated. I am hesitant to do this since then the children records will go through the entire save procedure (including a good amount of Apex code), so it would add a bit more processing to the Apex transaction. My question is, when would you go ahead with this request vs pushing back and trying to find another solution (i.e. batch update of the child records every hour/night, new business process-- after updating the parent, go and check this checkbox on the children, . . . )? In general there shouldn't be more than 5 child records per parent that need to be updated.
We have a test class that is now failing with this error:

System.DmlException: Upsert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AssetTrigger: execution of AfterInsert
caused by: System.DmlException: Update failed. First exception on row 0 with id 0016C000007X172QAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.ListException: Row with duplicate Name at index: 2
Trigger.AccountTrigger: line 48, column 1: []
Class.dlrs.RollupService.Updater.updateRecords: line 1248, column 1 Class.dlrs.RollupService.UpdateWithoutSharing.updateRecords: line 1291, column 1 Class.dlrs.RollupService.updateRecords: line 1219, column 1 Class.dlrs.RollupService.handleRollups: line 855, column 1 Class.dlrs.RollupService.rollup: line 205, column 1 Trigger.AssetTrigger: line 40, column 1: []


I assume the main issue is the duplicate row name so I searched arounf for that. I saw this thread https://developer.salesforce.com/forums/?id=906F000000091hDIAQ, and I tried to change to SOQL as the last answer suggested but that didn't help. I also added debug statements to the AccountTrigger after line 48, one of which counts the number in the map, and it does match the number in our custom setting. Maybe of note, we have a custom setting from a managed package that has the same name, just with the namespace on the front. But that is not new. What is new is that we were using Rollup Helper and are now trying to implement Declarative Lookup Rollup Summary Tool: https://github.com/afawcett/declarative-lookup-rollup-summaries

Any ideas? Thanks so much to anyone who even looks and considers trying to help!
I am working on an Apex test class with four test methods that passed with 100% code coverage several weeks ago. Now when I run it in Eclipse all I get is an ID with a green checkmark:
Apex Test Result issue
When I click to open it up, there is nothing underneath, and code coverage shows at 0%. Our sandbox has been upgraded to Spring 17, and I have read posts about needing upgrade the project but I cannot find that option, so I created a new project instead and it still is not working. I am using a Windows machine with Eclipse Mars version 4.5.2. What am I missing here? Thank you!
This is not a how to question, but a best practice/opinion question. I have a request to update a calculation on specific child records when a field on a parent record is updated. I am hesitant to do this since then the children records will go through the entire save procedure (including a good amount of Apex code), so it would add a bit more processing to the Apex transaction. My question is, when would you go ahead with this request vs pushing back and trying to find another solution (i.e. batch update of the child records every hour/night, new business process-- after updating the parent, go and check this checkbox on the children, . . . )? In general there shouldn't be more than 5 child records per parent that need to be updated.
We have a test class that is now failing with this error:

System.DmlException: Upsert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AssetTrigger: execution of AfterInsert
caused by: System.DmlException: Update failed. First exception on row 0 with id 0016C000007X172QAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeUpdate
caused by: System.ListException: Row with duplicate Name at index: 2
Trigger.AccountTrigger: line 48, column 1: []
Class.dlrs.RollupService.Updater.updateRecords: line 1248, column 1 Class.dlrs.RollupService.UpdateWithoutSharing.updateRecords: line 1291, column 1 Class.dlrs.RollupService.updateRecords: line 1219, column 1 Class.dlrs.RollupService.handleRollups: line 855, column 1 Class.dlrs.RollupService.rollup: line 205, column 1 Trigger.AssetTrigger: line 40, column 1: []


I assume the main issue is the duplicate row name so I searched arounf for that. I saw this thread https://developer.salesforce.com/forums/?id=906F000000091hDIAQ, and I tried to change to SOQL as the last answer suggested but that didn't help. I also added debug statements to the AccountTrigger after line 48, one of which counts the number in the map, and it does match the number in our custom setting. Maybe of note, we have a custom setting from a managed package that has the same name, just with the namespace on the front. But that is not new. What is new is that we were using Rollup Helper and are now trying to implement Declarative Lookup Rollup Summary Tool: https://github.com/afawcett/declarative-lookup-rollup-summaries

Any ideas? Thanks so much to anyone who even looks and considers trying to help!
I am working on an Apex test class with four test methods that passed with 100% code coverage several weeks ago. Now when I run it in Eclipse all I get is an ID with a green checkmark:
Apex Test Result issue
When I click to open it up, there is nothing underneath, and code coverage shows at 0%. Our sandbox has been upgraded to Spring 17, and I have read posts about needing upgrade the project but I cannot find that option, so I created a new project instead and it still is not working. I am using a Windows machine with Eclipse Mars version 4.5.2. What am I missing here? Thank you!
Hi,

I am facing an issue in one of the orgs when Users have suddenly lost access to records using manual sharing. Access to records of the Object is based on set of Sharing Rules as well as Manual Sharing rules added upon insertion of the child record with a specific data related to it, then based on that criteria Manual Sharing record is inserted granting access to the Users meeting such crtieria. I have checked the changes made to the childred records and there's been no changes after it was created a few weeks ago, at that time users had access to the parent records, but lately some of them has lost acces, I queried the sharing records and there are none for those Users, neither any exist when adding isDeleted = true. Is there anything that could cause such issue? Also I am unable to reprcoduce it so far, would you please help me?

Thanks in advance