0

I have been having issues setting up a scratch org. So I decided to try out (in Intellij/IlluminatedCloud) creation of a new project under the Sandbox Organization Type. I used my scratch org log in and security token that I generated via CLI and the instance was spun up successfully.

I can make edits and everything looks exactly like it does with a sandbox instance with the exception of one folder: out

I notice that every time I save a change it is pushed to the out > production folder.

I am concerned that I am connected to my scratch org but it is pushing to the associated production org. Is this possible from a scratch instance?

If it is in fact pushing to production, how am I able to save changes to solely my scratch org?

enter image description here

  • Have you verified if indeed changes are pushed to production as well? I would doubt if making changes in a scratch org is pushing it to production. – Jayant Das Jan 31 at 17:41
  • unfortunately I don't have access to a production login. the only way I know to check is to actually login to prod and see if the updates are made. – Olivia Jan 31 at 17:43
  • In that case there's no way that your changes will make it to Production. In that case I would imagine that you did not setup the scratch org, rather an admin created one for you. – Jayant Das Jan 31 at 17:44
  • Additionally to confirm - are you using a Scratch Org or a Sandbox for your build? Your question suggests that you created a scratch org but it also mentions sandbox. – Jayant Das Jan 31 at 18:59
  • I am using a scratch org log in BUT when I set up a new project in Intellij I set it up as a sandbox organization type. Although I am able to made edits, when I open the scratch org with the typical sfdx force:org:open I am only able to see my newly created class and not able to see any of the other metadata in the scratch org which leads me to believe it is not actually set up correctly. – Olivia Jan 31 at 19:49
1

Rolling up information from comments.

You are using Scratch Org and that you are building your code against a Scratch Org. Primarily your questions here are:

  1. I am concerned that I am connected to my scratch org but it is pushing to the associated production org. Is this possible from a scratch instance?

  2. If it is in fact pushing to production, how am I able to save changes to solely my scratch org?

Disclaimer - I don't have working experience on IlluminatedCloud, but the content here is applicable for Salesforce DX.

For #1, you cannot push a code to any org (scratch, sandbox or production) unless you have authorized that Org. In your scenario as you have mentioned in comments that you don't have access to Production, so it is unlikely it is going to Production. Once you authorize an Org, any further CLI commands run in IDE are applicable on the Org that you have authorized. So as long as you only have your Scratch Org authorized, your code will not be deployed to any other instance.

For #2, it seems you are making edits to the code locally only and that you are then verifying it in your Scratch Org. Making changes locally within IDE does not migrate the changes to the Scratch Org. You will need to push your code using the CLI command sfdx force:source:push to Scratch Org for it to be available there. This trailhead unit will help you to get an overview as how source code is transmitted between your local copy and Scratch Org.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.