Clone Salesforce objects with children In a previous post, I outlined an Apex cloning method that copied an sObject in its entiretyall data values included. Recently there have been some comments and questions on the post asking if it would be possible to use the method to create a way to clone an object and its children via a custom button on an object page without extensive development expertise required.
You will be working the next few hours in a rushed mode trying to fix something that should have been fixed weeks ago. How can this risk of a failing deployment be mitigated? Listed below are 5 steps that if implemented from the start will make your production deployment day a much smoother process.
Write Unit Tests for Quality and Coverage. Set a process rule at the beginning of the project that if a developer touches a piece of code that before that code is considered complete that the class must pass all tests at a specified percentage.
Having consistent unit test expectations will drive a number of positives during the project. These include… a It will promote test-driven development.
This means that developers should be writing tests first before writing the actual code. This will encourage smaller method and class sizes. This will setup for easier testing and more re-use of helper classes. The test should be run at some minimal frequency like daily or weekly.
If any class is under the specified test coverage limit, then it is sent right back to that developer. There is enough to do on production deployment day without having to deal with this error.
Get this work done during the iterations of the project.
From the Beginning… Have a single place where all changes for a project are saved. When the deployments are being setup a list of all the changes in the project will need to be referenced.
Eclipse can be used to generate some of these changes as it can compare the source and destination orgs and provide a list of the differences. But this list will not include all changes in the org as there are many point-and-click options in Salesforce that will not show up with Eclipse.
Change needed to be tracked for things like Org Wide Defaults, validation rules and workflows and approvals. Having a simple spreadsheet seems to do the trick. Have columns to mark the file name, why it was changed, who changed it and when it was deployed.
A source-code version control system can also get a list of part of the changes to a Salesforce system, but it will not get you all of the parts.
Using Jira to track all changes can also be a way to pull lists that need to be deployed. If the deployment is planned for a certain date then start building your deployments a week in advance if possible. On large orgs it can take up to 2 hours to do a deployment because all of the tests need to run.
When you only finding a few problems with each each test run of a deployment you can see how that can eat up days very quickly. Make use of the Validate button for this process with Change Sets and the same option exists with Eclipse. The deployment can just be validated without the deployment actually taking place.
Then the deploy package can just be sitting there ready to go for when the time comes. This will give the team a lot of confidence that it is ready to go and the team can focus on the other go-live activities. Take Care of the Triggers Triggers are very powerful, but they must be done right.
One simple example is that within a set of code you can only do SOQL queries. So if you would try to do a query for each of the records passed into the trigger within a simple for loop, then the trigger would fail. Do unit tests that submit a set records at one time for an update, insert or delete depending on the trigger.
Use a loop to create a list of objects and then use one DML statement to do the update, insert or delete. These objects are so important that they deserve to have multiple sets of eyes on them. Once developers see some best practices with triggers, they will understand it, but those code reviews or paired programming sessions will be invaluable so that a rogue trigger does not cause a problem in production.
Take special care of the order of the deployment and the profiles Profiles have a lot of information in them and they depend on other objects being in the destination org when they are deployed.
If the deployment can be broken up in pieces, this can be a way to simplify the process.
Custom objects and new fields can be pushed first as they do not depend on anything. Then the code and Visualforce pages along with validation rules, workflow and approvals can be pushed. Finally profiles can be pushed now that all of the dependent object for a profile are in place.Charles is a motivated senior Salesforce consultant and developer with over six years of experience, focused on finding new and creative ways of leveraging the iridis-photo-restoration.com platform to address the ever-changing needs of business organizations.
Usually Winter release is one of the bigger releases of Salesforce because Salesforce aligns it with their mega event Dreamforce. So, if you haven't got a chance yet to read Winter ’18 release then recommendation would be to read Winter ’18 release first before deep dive into Spring ’18 release.
Aug 27, · Tips on Passing the iridis-photo-restoration.com Advanced Developer () Certification Exam. Last week I passed the first part of the Salesforce Advanced Developer () Certification, which was a 69 question multiple choice exam that required a 73% to pass.
Learn about the Salesforce Developer Console; easy to use and provides additional functionality for beginning coders. Through your browser and the Developer Console you can create, debug, and test your iridis-photo-restoration.com code.
You’ll be asked to name the class. Then you write your code and save it. To create a new trigger. In the menu, click. Salesforce DX: Dev hub to plan, build, test, and deploy. Mobile Dev: Tools to build, run, and manage apps.
In-Class Learning. Certification. Communities. Trailblazer Community. Partner Community. Interested in a chance to win a free student trip to Dreamforce? Challenge. Salesforce Navigator. Salesforce Navigator is an awesome extension that is still relatively new.
Matt Lacey has a very good article on its capabilities, but essentially it will allow you to search for any screen you can find in the admin from any page.
On top of that, it is even looping in the Tooling API to allow cool things like adding custom fields on the fly.