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
$$ 

Deployment Questions

Hello All, 

I have a small question related to deployment.
The scenario is, I am deploying a class and a trigger, and there are users working on the system already.
The class and trigger updates the Stage field on the primary object. So if a user is working on the system on a record, and i deploy it to production, is there a thing like the current record where the usr is working wont be affectd as it will hold the old logic in class in its temporary memory. Or the Status update would malfunction due to the deployment of code/ throw error as it does throw errors to users when we deploy visualforce pages.
How does it work?
Any help is highl;y appreciated.
Steven NsubugaSteven Nsubuga
Never seen it happen, but I guess it is possible!!
That is why Salesforce has some guidelines for deployment to production, here is a summary:

Plan Your Production Deployment
Any time you deploy changes to a production environment, your users are directly affected. It’s a good idea to have guidelines for rolling out new functionality.
  1. Don’t break anything.
    1. Release your production functionality in a test environment first. If you successfully deploy and test in a full-copy sandbox, you can be fairly confident that your deployment to production will succeed.
    2. Back up all your metadata.
    3. Have a backup plan, just in case. One method is to create another sandbox as a backup. The backup sandbox contains change sets and scripts to revert as many changes as possible, plus the manual steps required.
  2. Schedule the release.
    1. Create and announce a maintenance window during which your organization is unavailable to most users. Try to make this time during off hours or in periods of low activity.
    2. Use profiles to control maintenance updates.
  3. Inform users of every change.
    1. Create detailed release notes that document the new functionality and behavior changes.
    2. Send an email announcing the main features with a link to the release notes.
    3. Create webinars and training sessions to educate users.

Use Profiles to Limit User Access
During a deployment window, you can use profiles to limit end-user access to the production organization.
  1. Alert all active users about the maintenance window using the email wizard. From Setup, enter Mass Email Users in the Quick Find box, then select Mass Email Users.
  2. Create a profile to lock users out during the maintenance window by editing the login hours. Be sure that system administrators or integration users have access if they need it.
  3. Roll out objects, tabs, and apps to different user profiles if you want to allow some users access for acceptance testing.
If your organization includes many profiles, use the following strategy for setting up a maintenance window.
  1. Create a profile named Maintenance with all login hours locked out.
  2. Use the Data Loader to extract and save a mapping of users and their user profiles.
  3. At the beginning of the maintenance window, use the Data Loader to change all user profiles, except the administrator’s, to the Maintenance profile. It is important to leave login access with the administrator. Otherwise, all users could be locked out of the system indefinitely. If integrations are going to run during the maintenance window, also don’t lock out the integration user.
  4. At the end of the maintenance window, use the Data Loader to reload the users with their original profiles.


Check all this out and more in this Trailhead (https://trailhead.salesforce.com/en/modules/alm_deployment/units/alm_deploy).