Code Monkey home page Code Monkey logo

Comments (16)

mustafaturabali avatar mustafaturabali commented on August 14, 2024 1

HI.. in case if there is still someone struggling with this, I would like to share what is probably wrong with the code. If you are like me who removed the fflib_ prefix using find/replace, you must not have noticed that QueryFactory instance being passed into parameters is also named queryFactory. In this case, the compiler is looking at the instance variable to find a variable named SortOrder and not enum.

I made this same mistake of removing the fflib_ prefix.. better get it back :). @afawcett Thanks a lot for this wonderful library.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

I'm not sure, i've just deployed the master branch to a brand new developer.salesforce.com org it deployed fine.

What its complaining about is an enum which defined at the very top of fflib_QueryFactory. Sometimes other compilation errors are the cause, does fflib_QueryFactory compile ok?

from fflib-apex-common.

tmowbrey avatar tmowbrey commented on August 14, 2024

HI Andrew. I did not use the deployment package. I copy and pasted the QueryFactory, SecurityUtils, SObjectSelector, SObjectDescribe, and SObjectDomain Classes (including test code) as when I initially used this framework I removed the fflib_ prefix on the classes (mistake on my part but now the framework is integrated into my codebase and changing the class names would require additional effort I was hoping to spare myself). All classes compile without error except for SObjectSelector.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

I see, do you see the enum definition at the top of the QueryFactory class? If you hit Compile All Classes link on the Apex Classes page what errors do you see?

from fflib-apex-common.

tmowbrey avatar tmowbrey commented on August 14, 2024

Yes, the enum definition is at the top of the QueryFactory class. The error I end up with is: Error: Compile Error: Type is not visible: QueryFactory.SortOrder at line 348 column 13.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Hmmm most odd, and the enum is public visibility? Is there anyway you can zip or give me access to take a look more directly? Are these the classes where you removed the fflib or the latest from the repo?

from fflib-apex-common.

tmowbrey avatar tmowbrey commented on August 14, 2024

Hi Andrew, I just added you to a private repo /tmowbrey/apex-cpp which has all of the fflib-common classes as well as the few additional classes I have been working on today.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Thanks just taking a look now.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

I have updated your repository after compiling commenting out references to custom obejcts/fields not present in the repo and it now compiles in a blank Developer Org. I did notice that your QueryFactory is an older version, which does not have the SortOrder enum defined as public. Please try taking the latest fflib_QueryFactory.cls and fflib_QueryFactoryTest.cls and update your code, the latest fflib_SObjectSelector needs them. As you said might be better if you can switch back to using fflib prefix then it will be easier to keep the library as a whole up to date.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Just wondering, did this help you sort your compile error?

from fflib-apex-common.

tmowbrey avatar tmowbrey commented on August 14, 2024

Hi Andrew, still not working :( When you compiled the code in the DE, did you un-comment the place I was getting errors (line 348 - 355 in SObjectSelector)?

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Nope, you can see my changes here.

The problem is that SObjectSeletor your using requires a more recent version of QueryFactory (with the SortOrder enum at the top of the QueryFactory class made public).

Try taking a fresh copy of QueryFactory from the repo here, notice how the enum is public. You really need to take the latest QueryFactoryTest also.

from fflib-apex-common.

tmowbrey avatar tmowbrey commented on August 14, 2024

Hi Andrew,

I think this is quite a bit of work for little value, I don't want to waste more of your time. I am going to get back and adjust all the classes and references back to fflib_ so that the updates transition smoother. I really appreciate your help and the time you have put in here.

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Yeah I think thats for the best to be honest and no worries, happy to help!

from fflib-apex-common.

afawcett avatar afawcett commented on August 14, 2024

Your very welcome @mustafaturabali, but its not just me, there are now many contributors! 👍

from fflib-apex-common.

tjsully avatar tjsully commented on August 14, 2024

@mustafaturabali Thank you!! I had removed the prefix as well and I was getting the same error.

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.