Comments (8)
You may want to view the recently updated fflib_SobjectSelector (pull 91 - #91).
RecordType.SObjectType.getDescribe().getName() needs to be updated to RecordType.getSObjectType().getDescribe().getName() and may be the source of your issue.
from fflib-apex-common.
Thank you. I will merge in the pull request and create a package and try it. There's no other way to verify whether it addresses my post-install problem other than creating a new package. Please vote for this idea if you have a moment: https://success.salesforce.com/ideaView?id=08730000000DpREAA0. If it works, I will report back here. Might be a few days.
from fflib-apex-common.
@tfuda yep we've hit this recently as well, we have a case out with Salesforce on it, be interested actually if the recent change does resolve it, let us know. And yep testing post install problems is not great. I've just upvoted your idea and will tweet.
from fflib-apex-common.
Sadly, I created a package today that included the code change from pull request #91. Unfortunately, I am still getting the same failure from my InstallHandler code when the static initializer for the STANDARD_WITHOUT_CURRENCYISO set is initialized. So, I believe this is still problematic for InstallHandler classes that wish to utilize fflib_SObjectSelector.
from fflib-apex-common.
Ok, i'll see if i can get an update on the fix related to this issue.
from fflib-apex-common.
@tfuda We've recently included the enterprise patterns into our managed package.When we used fflib_SObjectSelector in a class which is called by post install class, we're receiving the following error even though the user is System Administrator DMLManager.CRUDException: Access Denied: OP_INSERT .Is it because of the with sharing keyword on fflib_SObjectSelector class and Is it recommended to use fflib_SObjectSelector in post install context?
from fflib-apex-common.
@cb-chaitanya -- a few things:
- DMLManager is not part of this project -- it's a separate library that is compatible with fflib-apex-common
fflib_SObjectUnitOfWork
but it has nothing to do with this thread (fflib_SObjectSelector
) which is dealing with SOQL queries during package installation - Post-Install code runs as a ghost user -- this is "documented" over here: https://salesforce.stackexchange.com/questions/32607/installhandler-runs-under-a-special-ghost-user-what-rights-does-it-have -- in short, you need to both make sure your InstallHandler class is declared 'without sharing' and any DML you're doing needs to ignore CRUD and FLS
Lastly, be careful about any DML you do in an InstallHandler class. If you schedule Scheduled Apex or run Batch Apex, those async jobs will run as the ghost user and you'll find all sorts of strange permission problems that you have no way of troubleshooting since you can never impersonate that user. Plus, if you include the Last Modified By field for any records modified by the ghost user on a Report, the records will not appear because the running user will not have access to that ghost user's User record.
from fflib-apex-common.
@daveespo Thank you so much for your valuable information.We're planning to schedule a job on installation that does DML intense job.But for now we'll explore different options to schedule this.
from fflib-apex-common.
Related Issues (20)
- Run AEP Apex Sample Code tests against the core AEP Commons library on each push
- Unable to Deploy - Unhandled Exception : java.lang.RuntimeException HOT 1
- Unit test failure in multi-currency org HOT 4
- Deploy button doesn't deploy because there are test failures HOT 1
- Expected a QueryException due to read only user not having access to Opportunity HOT 7
- Switch to Inherited Sharing on SObjectDescribe and SObjectSelector HOT 2
- With latest fflib, do TriggerHandlers become service class consumers? If so what happens to UoW? HOT 6
- Selected tests in fflib_SObjectSelectorTest fail in an org with encryption enabled on Account.Name HOT 2
- Selector Mocks to Include SOQL Query Retrieve Check HOT 1
- fflib_SObjectUnitOfWork doCommitWork executes all dml for all registered types even if there are no changes
- Update README as session recordings are not available HOT 2
- fflib_SObjectDescribe.cls fails to resolve cross-object field paths for Person Accounts
- Aggregate SOQL support. HOT 2
- Disable Savepoint in tests HOT 4
- Inconsistent Code Coverage and Test Failures in fflib-apex-common HOT 1
- fflib_SObjectSelector and fflib_SObjectUnitOfWork have insufficient test code coverage. HOT 2
- Add queryWithBinds to Selector layer HOT 2
- Unit test failing fflib_SecurityUtilsTest & sysadmin_objectAndField_access HOT 8
- Coverage of UnitOfWork class HOT 1
- Versioning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fflib-apex-common.