Code Monkey home page Code Monkey logo

Comments (5)

afawcett avatar afawcett commented on August 14, 2024

Take a look at the sample application, https://github.com/financialforcedev/fflib-apex-common-samplecode. Specifically the controller line here, https://github.com/financialforcedev/fflib-apex-common-samplecode/blob/master/fflib-sample-code/src/classes/OpportunityApplyDiscountController.cls#L56

OpportunitiesService.applyDiscounts(
            new Set<ID> { standardController.getId() }, DiscountPercentage);

from fflib-apex-common.

sarava77 avatar sarava77 commented on August 14, 2024

Hi,
I saw the application. Could you please confirm me . As per your reply I need to create the instance in the controller and on save action I need to pass it to the Domain class to do all the logical stuff. What I was doing is getting the instance from domain. So it should be list because of this I can't use it in VF page to create new record.

And one more thing still I am not clear how are you enforcing the CRUD and FLS security .Could you please explain me this where do I need to Do the DML operation and how?.

Thanks,

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

"As per your reply I need to create the instance in the controller and on save action I need to pass it to the Domain class to do all the logical stuff."

  • No exactly, the controller layer only calls the service layer as per the example. The service layer method internally can utilise functionality encapsulated within one or more domain classes

"What I was doing is getting the instance from domain. So it should be list because of this I can't use it in VF page to create new record."

  • I am not 100% sure what you mean here, maybe a code sample would help from you?

"And one more thing still I am not clear how are you enforcing the CRUD and FLS security .Could you please explain me this where do I need to Do the DML operation and how?."

  • Currently only CRUD is enforced, this is done in the fflib_SObjectSelector class (for the base class methods automatically, and by calling the assertIsAccessable method for your Selector methods you create, see the sample selector classes) and fflib_SObjectDomain (you don't need to do anything here, its fully automatic) classes.
  • FLS support is currently being discussed and there is in fact a branch we we are using to work on how this is to be done with other community developers

Have you had a chance to read my series of articles on Developer Force Wiki and/or check out the recording of my Dreamforce 2013 session? If not i would recommend you look at these. The links are on the Readme for the repo.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Please let me know if the above does not help you and we can talk again! :-)

from fflib-apex-common.

sarava77 avatar sarava77 commented on August 14, 2024

Sorry I am working with the code sample to give you the exact problem which
I am
facing . Could you please give me some more time because I also busy in my
client
implementation.

Thanks,

On Mon, Mar 10, 2014 at 10:01 AM, Andrew Fawcett
[email protected]:

Please let me know if the above does not help you and we can talk again!
:-)

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-37167190
.

Saravanan Selvaraj

from fflib-apex-common.

Related Issues (20)

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.