Giter Site home page Giter Site logo

lukethacoder / fflib.dev Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 0.0 196 KB

⚡ Unofficial and semi-opinionated fflib documentation - Apex Enterprise Patterns

Home Page: https://fflib.dev

License: MIT License

JavaScript 0.83% TypeScript 28.27% CSS 6.67% MDX 64.23%
apex-enterprise-patterns salesforce-apex salesforce-developers salesforce-documentation

fflib.dev's Introduction

fflib.dev

Unofficial fflib documentation

Running Locally

pnpm install
pnpm dev

Icons

Tabler Icons are used throughout the site.

fflib.dev's People

Contributors

lukethacoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fflib.dev's Issues

Issue with fflib Framework Auto-Assigning AccountId in TriggerFeedback for “Triggers”

Summary:
We are experiencing an issue with a trigger utilizing the fflib (FinancialForce Apex Common) framework in our Salesforce instance. The trigger is designed to remove the AccountId from a record when a specific checkbox is checked. However, despite the trigger's logic, the AccountId field is being automatically reassigned due to the behavior of the fflib framework.

Details:
Trigger Objective: To clear the AccountId field when a particular checkbox is marked as checked.
Observed Behavior: Instead of the AccountId being cleared, it is automatically re-assigned by the fflib framework.
Framework: fflib (FinancialForce Apex Common)
Impact: This issue is blocking the completion of a critical story in our development pipeline, potentially affecting our delivery timeline.
Steps to Reproduce:
Check the specific checkbox No Assigned Patient field designed to trigger the removal of the AccountId.
Observe that the AccountId remains or is re-assigned, contrary to the trigger logic.
Requested Action:
We need assistance in resolving this conflict between the trigger logic and the fflib framework's auto-assignment behavior. This may involve adjusting the trigger logic, configuring the fflib framework settings, or implementing a workaround that aligns with our requirements.

Priority:
High – This issue is urgent due to its impact on a critical story in our development process.

Please advise on the best course of action to resolve this issue. Thank you for your prompt attention.

Feedback for “Domain Layer: Basic Example”, need Custom Metadata examples

The documentation says to create a ApplicationFactory_DomainBinding Custom Metadata Record, but I'm not sure it's actually used.

I receive errors apparently because I don't have a Binding Custom Metadata Record, but I don't see any instructions on how to create it.

error with no Binding cmr:
di_Injector.InjectorException: Binding for "iapplicationsobjectselector" and SObjectType "Contact" not found

error when attempting to create Binding cmr:
IContacts cannot be constructed

Feedback for “Domain Layer: Basic Example”, setting up IApplicationSObjectDomain

I'm trying to implement this for the first time in a new org. Writing the interface for the Contact object, I get this error:

Invalid type: IApplicationSObjectDomain

I'm not finding any place in the documentation to explain how to set up IApplicationSObjectDomain, and wondering if that step was skipped.

public interface IContacts extends IApplicationSObjectDomain {

}

Question for “Installation”

Do we have to just deploy once to our org and then the fflib library will be updated by itself or do we have to deploy again when there are something new?

Unit of Work: Register Relationship during insert fails if both records are of the same SObjectType

How to recreate:

`fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(MY_SOBJECTS, mockDML);

Account parent = new Account(Name = 'Parent');
Account child = new Account(Name = 'Child');
uow.registerNew(parent);
uow.registerNew(child);
uow.registerRelationship(child, Account.ParentId, Parent);
uow.commitWork();

child = [SELECT ParentId FROM Account WHERE Id =:child.Id];
Assert.isNotNull(child.ParentId);
Assert.areEqual(parentId, child.ParentId);
`

Expected behaviour is that this should pass, but it doesn't. This code might need to be fixed, I'm typing this freely. The solution we found is through an extension class to:

`
public void registerRelationship(SObject record, Schema.SObjectField relatedToField, SObject relatedTo){
if (record.Id == null && relatedTo.Id == null && record.getSObjectType() == relatedTo.getSObjectType()){
record.Id = fflib_IDGenerator.generate(record.getSObjectType());
uow.registerRelationship(record, relatedToField, relatedTo);
uow.registerDirty(record);
record.Id = null;
}else{
uow.registerRelationship(record, relatedToField, relatedTo);
}
}

`

I think it would make a nice addition to the framework

Feedback for “Selector Layer: Extra Queries”

There is a typo in the code.

Instead of

@TestVisible
private String getExtraQueries(Boolean removeFirstAnd) {
String extraQueries = setFilterIsActive();
return removeFirstAnd ? extraQueries.replaceFirst('AND', ' ') : extraQueries;
}

it should be

@TestVisible
private String getExtraQueries(Boolean removeFirstAnd) {
String extraQueries = getFilterIsActive();
return removeFirstAnd ? extraQueries.replaceFirst('AND', ' ') : extraQueries;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.