You need to sign in to do that
Don't have an account?
DevNV
Testing Apex Managed Sharing Recalculations - documentation not working
Hi all,
I'm working on the sharing recalculation coding and have tried to implement the example code in the Apex Code documentation (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_recalc.htm). I'm getting errors when saving the test code as documented at the bottom. The calls to start() and execute() are not saving with the error that the method does not exist.
Has anyone else figured it out?
Cheers,
Niki
OK, sorry for the delay. The documentation did have a few issues and the internal team is getting those corrections in.
They also sent along this corrected version:
Updated the code with a new example from the documentation team - 12/12/2011
And mentioned that:
"It calls the batch job through the Database.executeBatch() method, which is the recommended way.
Note that the customer could make his code work with a quick fix by just declaring the Database.BatchableContext variable and passing it uninitialized to the 3 methods (start, execute, finish) but this is not the recommended way."
Hope that helps.
All Answers
Are you using the samples out of the box? Same data setup, etc.? I can try them out on this and see...
It's pretty much the same, although I'm using the jobs object called SFDC_Job__c rather than just Job__c. I adjusted the SOQL for my object but otherwise the structure is the same. The problem is in saving the test method as it is in the documentation - besides the typo on one the select statement not having [ ]'s around it, it is giving errors on calling the Start and Execute methods directly. Any thoughts would be appreciated.
Sorry - brief delay trying to get this enabled on my own end...
Just a quick ping that some internal folks are going to take the sample for a test drive. Sorry again for the delays, there's holidays and deadlines abound - which often don't mix...
OK, sorry for the delay. The documentation did have a few issues and the internal team is getting those corrections in.
They also sent along this corrected version:
Updated the code with a new example from the documentation team - 12/12/2011
And mentioned that:
"It calls the batch job through the Database.executeBatch() method, which is the recommended way.
Note that the customer could make his code work with a quick fix by just declaring the Database.BatchableContext variable and passing it uninitialized to the 3 methods (start, execute, finish) but this is not the recommended way."
Hope that helps.
Great, this seems to work now in my environment as well. Thanks for fixing it up!