The Welkin Suite Forum

Build command for all classes and pages



Build command for all classes and pages

  • Please log in to reply

#1

mlochiano

    Posted 19 Jan 2017

    Our appication has hundreds of classes and pages. It would be convenient if there was a command to recompile everything in the project. There are times when a reference is changed in one class, but dependent classes are overlooked. We may only find this when a new package is built in Salesforce. That may be several weeks later and the immediate knowledge may be somewhat difficult to reconstruct.


    3 replies to this topic

    #2

    kate.dulko

      Posted 19 Jan 2017

      Hi Mark,
       
       
      Thank you for sharing this idea with us.
      May I please clarify some more details so we can better understand the use case and can implement a good solution in the future? However, I will start with the small overview.
       
      Right now when you send something to Salesforce there might be a couple of different situations:
       
           - If you build a class - no dependencies are detected by TWS, but Salesforce itself won't compile your changes if some dependent class brakes (e.g. interfaces changed, etc.)
           - If you build a page or a component - the corresponding controller or controller extension is built as well so there will be less chances to break something
       
      Taking this into account can you please clarify a bit in what exactly cases there might be a broken dependent class missed by Salesforce? Or if it is more related to the "dynamic Apex" - will recompiling everything help to detect any issues?
       
       
      Looking forward hearing back from you.
       
      Thank you,
       
      Kate

      Kate Dulko
      Customer Relations

      The Welkin Suite

      twitter: @KateDulko
      skype id: d_katerina
      e-mail: kate.dulko@welkinsuite.com

       

        


      #3

      mlochiano

        Posted 19 Jan 2017

        Kate, You are correct in that if one class calls another class, Salesforce marks the 'called class' as dependent and will automatically compile that class. However, the reverse is not true, if (for example) you changed the method name in a class, other classes that utilize it will not be automatically recompiled. In particular, any test class that is used to exercise the base class will not be automatically recompiled -- and are thus broken. The same is true for any pages that might rely upon the class. Only by periodically recompiling all classes, components, and VisualForce pages would this mistake be discovered. While Salesforce does provide a 'compile all classes' function on the Apex Classes page -- that does not cover any VisualForce pages. The only time that Salesforce compiles everything is if you have a Managed Package and do a full rebuild during an upload. Sp the 'down' classes are detected and recompiled, but the 'up' classes are not. This is where mistakes are hidden. This level of full compile is what would be an excelent new feature for your application.


        #4

        vlgubanovich

          Posted 20 Jan 2017

          Hi Mark,


          Thank you for bringing this into the light. To be honest I have faced such situation so rarely, so haven't paid much attention to it.

          This is a very interesting issue and we will definitely investigate how we can overcome it - there's a couple options:

          - Adding such a button that you have mentioned

          - Sending dependent files as a part of deployment/build process (like we are doing with controllers for VF pages).

          - Maybe we will find some other option to resolve this issue.

          However, there may be some challenges with the availability of API calls for such purpose (for example you can see my recent tweet with a quick example of such an issue - https://twitter.com/VGubanovich/status/822510427410079744).

          Anyway, thank you once more for bringing this to our attention.


          Best regards,

          Vladimir


          Vladimir Gubanovich
          Head of Product
           
          The Welkin Suite
          skype id: vladimir.gubanovich
          e-mail: vladimir.gubanovich@welkinsuite.com





          Boost Your Productivity. Get Started Today

          Try Free Trial