Questions tagged [fflib]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

fflib-apexmock not getting verified

I am using fflib mocks and at4dx Trying to test a simple controller method which is calling a selector method. Controller Method: public with sharing class MyController { public static String ...
2
votes
0answers
24 views

register relationship

I am using the unit of work design pattern (fflib) to persist objects; however, it does not register relationships, code as follows: fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork( ...
1
vote
1answer
496 views

FFLIB Unit of work. how to register a relationship on both new and existing record?

I have been trying to use the FFLIB enterprise service layer module to both insert a new record and update an existing record while registering relationships between both but I am unable to update the ...
1
vote
1answer
56 views

Selector Layer - fflib_SObjectSelector error on Cross-Object and Sub-Select Queries

I'm working on a skipe for this fflib and I'm facing this error when I try to execute a Cross-Object or Sub-Select query:. |WARN|fflib_QueryFactory.subselectQuery(Schema.SObjectType) is deprecated ...
0
votes
2answers
102 views

How to use fflib_SObjectSelector class? [closed]

I just came across Apex Enterprise Design patterns and this architecture has been really useful. I am trying to implement the selector layer and when I try to extend the fflib_SObjectSelector class, I ...
5
votes
1answer
84 views

Why are my matchers not working after adding an overloaded method?

To help getting past our permission checks during unit tests to test actual functionality, I created a mocking class so people could just call the mocking method they needed from that class for the ...
4
votes
2answers
592 views

fflib selector - configure Read and FLS - fflib_SObjectSelector vs fflib_QueryFactory

We're working on a managed package and planning to list it on AppExchange. We are using the fflib-apex-common library in our app. Now the question: what's the best way to configure Read and FLS when ...
3
votes
2answers
2k views

Stuck on Unit of Work Principles test in Trailhead

I am working on the Unit of Work Principles trailhead and seem to be stuck, I cannot get it to pass even though the test passes. I surmise it may be because it is testing other tests and looking for ...
2
votes
1answer
47 views

Do we have to force all FFLIB classes with `with sharing` keywords to pass security review?

I'm using FFLIB classes in my managed package and i just wanted to know if i should mark FFLIB classes use in my package with with sharing keyword to follow security review requirements ? Thanks,
4
votes
1answer
55 views

How to mock App Exchange package's API response?

I am using an app exchange package in my code, they have exposed a few global methods that I can use to get my job done. It all works beautifully. The issue comes with testing. I want to test ...
0
votes
1answer
152 views

Doing something dumb with queryfactory and relationship query

I've been using the fflib pattern in salesforce development since before the introduction of the query factory. I'm having a problem making a simple relationship query work using the queryfactory. ...
2
votes
1answer
160 views

Pros and cons of fflib-common-apex for ISV

This question is aimed to summarize advantages and disadvantages of using fflib-common-apex for developing managed packages for AppExchange. Overall fflib-common-apex and mocks are helpful and speed ...
2
votes
2answers
33 views

Which unit tests should check read access for user?

We are using fflib-apex-common in our project, and we implemented several selectors. By default fflib_SObjectSelector checks for Read permission. But now I am wondering what type of tests, and at what ...
1
vote
1answer
1k views

fflib apex common Usage [closed]

We have a existing salesforce implementation, we have most of the logic in triggers and trigger handlers. We are still using classic and no mobile or other UI. But still we are planning to implement ...
0
votes
1answer
100 views

How to add mandatory where clause in SObjectSelector subclasses

I have a Product selector class and would like to enforce a mandatory check on a Product field for every query on products. I'm assuming it has something to do with the QueryFactory, but since there ...
3
votes
1answer
821 views

fflib_ApexMock: How to mock static methods?

Static methods are called without creating instance of a class. The fflib_ApexMock library gives option to mock, but how to call static methods when mocking a class. Like in Mockito we have ...
5
votes
1answer
195 views

What value is there in an Application Service Provider

As I implement Andrew Fawcett's, Apex Common library referring to the fflib-apex-common-samplecode when necessary, I note that his ObjectService classes (i.e. OpportunitiesService.cls) are really more ...
4
votes
1answer
378 views

Apex Enterprise Patterns: Should UOW only be used with a DML transaction?

After completing the Apex Enterprise Patterns (AEP) trails from trailhead, there are a few questions that I have. One being, when is it necessary to use the Unit of Work (UOW) layer? Considering it is ...
1
vote
1answer
1k views

Salesforce Selector layer - subquery

We have been using FF library for Separation of Concerns framework and it is working great. We need to add subquery to it, but running into issues. Example I am following is from this article: https://...
-1
votes
1answer
512 views

Warning when using fflib_QueryFactory

When performing a sub query, I get the following message: WARN|fflib_QueryFactory.subselectQuery(Schema.SObjectType) is deprecated and will be removed in a future release. Use fflib_QueryFactory....
1
vote
1answer
259 views

how to prevent recursive trigger when using the financialforce enterprise design patterns library?

Trying to implement the popular Financialforce enterprise design patterns library, and not clear on if it provides baked in capability to prevent a trigger recursion. I've looked through the core ...
2
votes
1answer
536 views

Hello World for APEX Mocks

I am working on a project in which we need to test an APEX REST Service in such a way that no actual data is created in Salesforce during the testcases execution. I am new to APEX Development. ...
4
votes
3answers
590 views

How to unit test service layer without DML

Looking for best practices/suggestions on how to unit test a service layer method that creates new records based on input without having to issue the DML. An example would be ...
2
votes
1answer
325 views

Getting error when trying to use fflib

I am trying to learn fflib, in this i do have 3 layers Service, selector and domain level. I am getting a list of opportunity records to display on VF page using selector and I have added all these ...