function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shamrez AhmedShamrez Ahmed 

best way to deploy and test apex code

Hi

I am a newbie. I am just starting to learn salesforce programming. I wanted to know if there were any limits on how many times we could deploy/push changes to the server. I am creating a lightning web component. Even If I make a small change, I have to deploy the code to sandbox to test the change. Is this the only way to test changes? and if yes, is there any limit on how many times we can push changes from local Visual Studio to the server (sandbox for now)? Seeing so many limitations related to licenses I am worried i might hit a roadblock soon and it's not possible for a beginner to understand all types of licenses and nitty gritty of programming. Thanks!
Best Answer chosen by Shamrez Ahmed
Andrew GAndrew G
Hi Shamrez

there is no limit on the number of changes sets you push in a given time period. 

However, I would question your comment that "I have to deploy the code to sandbox to test".  How are you coding that you need to test any small change with a deployment?  Do you have a Sandbox that is your own to code in?  If so, why can't you set sufficient data in the Dev Sandbox to test development changes without the need to push to another Sandbox for testing?

If we think of a setup like:
My Dev Sandbox >> Testing Sandbox >> Production

Develop and developer testing in My Dev Sandbox.   When I'm happy, I deploy to Testing Sandbox for Peer / business testing.  

Regards

Andrew

All Answers

Andrew GAndrew G
Hi Shamrez

there is no limit on the number of changes sets you push in a given time period. 

However, I would question your comment that "I have to deploy the code to sandbox to test".  How are you coding that you need to test any small change with a deployment?  Do you have a Sandbox that is your own to code in?  If so, why can't you set sufficient data in the Dev Sandbox to test development changes without the need to push to another Sandbox for testing?

If we think of a setup like:
My Dev Sandbox >> Testing Sandbox >> Production

Develop and developer testing in My Dev Sandbox.   When I'm happy, I deploy to Testing Sandbox for Peer / business testing.  

Regards

Andrew
This was selected as the best answer
Shamrez AhmedShamrez Ahmed
Hi Andrew,

Thanks for the detailed reply. I just realized that I am not pushing changes to the sandbox yet. Our organization uses custom Auth therefore I was not able to connect Visual Studio to My Org in Salesforce. Until that auth is resolved by the infrastructure folks I started building the component in a developer account. So right now, I am coding in VS code and even If i change a single line of code, to test it I right-click "force-app > main > default" node and choose "SFDX: Deploy source to Org" option. That deploys the changes then I refresh the browser to test the changes. This is a very inefficient way of working. Is there an easy option to test changes or is this approach that I am using is the only option available and is this the right approach?

Please pardon my ignorance, I am very new to Salesforce. I am sure these are very basic questions. Thanks for your help.

Shamrez