How to run Apex anonymous code from Visual Studio Code

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
4
down vote

favorite












Is it possible / How would I run a block of Apex anonymous code from Visual Studio Code?










share|improve this question



























    up vote
    4
    down vote

    favorite












    Is it possible / How would I run a block of Apex anonymous code from Visual Studio Code?










    share|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      Is it possible / How would I run a block of Apex anonymous code from Visual Studio Code?










      share|improve this question













      Is it possible / How would I run a block of Apex anonymous code from Visual Studio Code?







      salesforcedx salesforcedx-cli visualstudiocode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 8 at 11:39









      Robs

      1,146423




      1,146423




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          In the command palette, if you type "sfdx ex" you will be offered this if you have some Apex text selected:



          SFDX: Execute Anonymous Apex with Currently Selected Text


          or this:



          SFDX: Execute Anonymous Apex with Editor Contents


          if you don't.



          Not too sure why there is also this .apex file thing too. As the project is open source you can see open issues, all issues, pull requests etc here https://github.com/forcedotcom/salesforcedx-vscode/issues.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f231715%2fhow-to-run-apex-anonymous-code-from-visual-studio-code%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            In the command palette, if you type "sfdx ex" you will be offered this if you have some Apex text selected:



            SFDX: Execute Anonymous Apex with Currently Selected Text


            or this:



            SFDX: Execute Anonymous Apex with Editor Contents


            if you don't.



            Not too sure why there is also this .apex file thing too. As the project is open source you can see open issues, all issues, pull requests etc here https://github.com/forcedotcom/salesforcedx-vscode/issues.






            share|improve this answer


























              up vote
              3
              down vote



              accepted










              In the command palette, if you type "sfdx ex" you will be offered this if you have some Apex text selected:



              SFDX: Execute Anonymous Apex with Currently Selected Text


              or this:



              SFDX: Execute Anonymous Apex with Editor Contents


              if you don't.



              Not too sure why there is also this .apex file thing too. As the project is open source you can see open issues, all issues, pull requests etc here https://github.com/forcedotcom/salesforcedx-vscode/issues.






              share|improve this answer
























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                In the command palette, if you type "sfdx ex" you will be offered this if you have some Apex text selected:



                SFDX: Execute Anonymous Apex with Currently Selected Text


                or this:



                SFDX: Execute Anonymous Apex with Editor Contents


                if you don't.



                Not too sure why there is also this .apex file thing too. As the project is open source you can see open issues, all issues, pull requests etc here https://github.com/forcedotcom/salesforcedx-vscode/issues.






                share|improve this answer














                In the command palette, if you type "sfdx ex" you will be offered this if you have some Apex text selected:



                SFDX: Execute Anonymous Apex with Currently Selected Text


                or this:



                SFDX: Execute Anonymous Apex with Editor Contents


                if you don't.



                Not too sure why there is also this .apex file thing too. As the project is open source you can see open issues, all issues, pull requests etc here https://github.com/forcedotcom/salesforcedx-vscode/issues.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 8 at 13:26

























                answered Sep 8 at 13:20









                Keith C

                91.2k1085189




                91.2k1085189



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f231715%2fhow-to-run-apex-anonymous-code-from-visual-studio-code%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay