Bloom R8 with Validations, Workflows, Lighting, and Scheduled Jobs
At least here, in parts of the Northern Hemisphere, schools are back in session, the northern snow birds are getting ready to head south, and some are taking our final boating outings, bike rides, and starting to think about the snow machines. The never ending circle of life is continuing, and so is our never ending circle of new releases.
We are happy to say that we have again extended the ability or our IDE to make your work in Salesforce more productive, so you can stay at the peak of innovation that is driving this platform forward. Even though you might not be using all of these functions every day, they will surly make your work more comfortable, and bring you more success. So let's see what we have for you in Bloom R8.
Monitoring and starting scheduled jobs
How many times over the last month have you had to schedule a new job in Salesforce? Sure, this is not an everyday task, but anyway it's still very common for both Developers and Administrators to need to schedule new jobs - we're having to do this for many different reasons and in absolutely different ways like:
- We can schedule new Apex jobs for some long-running periodic processes like nightly processing of leads, monthly calculations of summaries, etc.
- We can schedule new Apex jobs for some short-running processes that need to happen very often, like processing new records every 5 or 10 minutes, etc.
- We can schedule an existing job to execute only one time in order to check something or to process some legacy or new data
And we doubt that this is the full list of ways and reasons, but these are the ones that came off of the top of the head, as the most common ones.
While some of these options are easily configurable from the Salesforce Setup UI, some of them might require Anonymous Apex code - that's cool when you know Anonymous Apex Code, but if you don't, it adds dependencies on the other members of the team that does, and it steals time away from you and them. This is why in the Bloom R8 version of the IDE, we have added a new 'Scheduled Jobs' panel. Let's take a look at this in some more details, and see what options you will have in it.
First of all the purpose of the panel is to show you a list of your already scheduled jobs, so you won't need to open your browser to quickly check if there's something you're already looking for in the schedule already.
It seems pretty obvious that you would need to have an option to cancel any existing Apex Scheduled job or create a new one - and you have this! To do this, you can just right-click on the one that you are interested in, and select the 'Delete' option - this action will send a command to your Salesforce organization to remove this scheduled job.
Another option that is available for you in the job's context menu is the 'Open in browser' option - after clicking on this menu item, the IDE will open your browser, with the selected Scheduled Job, so you can examine its details and parameters.
Also in the Scheduled Jobs panel, you are able to configure the columns that are displayed for you in the table. As well as you can enable or disable the auto-refreshing of the list of your scheduled jobs, and specify how often this data should be refreshed. By default the auto-refresh functionality is disabled, so this won't consume API calls on your organization.
Regarding the creation of new jobs - there's many more settings to describe here, so let's proceed:
When you open the scheduled job creation window, you will find the following items there:
- a required field for the job name;
- a dropdown list where you need to select the Apex class that will be executed - in this list you will find all the apex classes from your TWS project, which implement the Scheduleable interface;
- a preferred Start Time, when the job will be executed for the first time;
- a block with details about the executions schedule - we will highlight this in more detail below;
- an Apex code text field where you can find generated Anonymous Apex and Cron expression(s) are used for scheduling a configured job (or jobs).
The IDE provides you with the following options for configuring a job's schedule:
- 'Run' - after selecting this option you can choose one of the 3 child options: run once at a preferred start time, run now, and run every X minutes, hours, or days. Please note, that if you select running a job every X minutes, the IDE will create multiple scheduled jobs (being more precise - 60 divided by X jobs), however this is a very good option when you are going to execute your class very often.
- 'Weekly' - using this option will allow you to schedule your job to be executed every weekday, weekend, or on certain days of the week.
- 'Monthly' - provides you with an ability to execute your job every month on certain days, like the 14th of every month, or for example, every second Monday and Thursday.
- 'Advanced' - you can use this to configure your own schedule for a job using a Cron expression.
In cases that the selected schedule results in multiple scheduled jobs, the IDE will notify you about this in the status bar of the window.
Expressions editor for Validation rules and Workflows
As our next step towards extending the declarative development capabilities that can be completed in the IDE, we have implemented the first iteration of our brand new expressions editor for Error Condition Formulas in Validation Rules and for Formula values in Workflow Rules. Beginning from The Welkin Suite Bloom R8, when you select any Validation Rule in the Admin panel, you will see the '...' button on the right side of the panel near the Error Condition Formula field, and clicking on it will open the newly implemented editor. Also, you have this same button near the 'Formula' input when selecting any Workflow Rule. Are you wondering what new capabilities does this provide you with?
Well let's take a look at what this gives to you!
This editor for expressions offers you the following Code Completion options:
- basic syntax highlighting that helps you to distinguish field names, global variables, functions, numbers, and strings - saving you time on reading and analyzing complex expressions;
- a completions list for all available fields, global variables, and functions that you might apply in the current context.
You might be asking yourself why do I need to be typing in manually expressions, when I can do the same with clicks in the Salesforce UI? Good question, but just try this out for yourself and you'll see just how much time you can save with these code completion features, especially if your expressions are complex, and if they include a lot of conditions! By the way, if you haven't started typing anything, and would like to get your completions list immediately - just press the CTRL+Space and it will appear.
We will carefully listen to any of your feedback about this functionality, and we will add improvements or changes in cases where you'd like to see something more, or something done in another way, so feel free to let us know about your ideas!
Making Javascript, Lightning, Visualforce and HTML Code Assistance even better! Once more :)
We've released a great update to our Code Assistance functionality for all frontend-related types of files just recently, but at least that same number of enhancements was left outside that release - just to stretch out the pleasure Ok, no, we always are in the progress and aim to bring you some more new cool features as soon as they're ready.
While most of the updates are related to the Lightning development we have not forgotten about Visualforce - no matter how good Lightning can be, we'll have a lot of Visualforce pages and components for years to come. So we need to be sure that it's easy to maintain and update them! This is why we have increased the number of supported visualforce tags. And of course, we've done the same for the Lightning markup - taking into account these changes, it should be easier to develop using both of these frontend approaches. Even more - you can see not only the markup tags and attributes in the Code Completion list for Lightning and Visualforce, but you'll also find there, documentation from the Salesforce's references, if they are available!
One more improvement that is related to the fact that the code completion is now aware of different HTML versions for Visuaslforce items, so it's up to you what "flavor" to use, and how strictly to follow the standards of HTML4, HTML5 and XHTML. By default, we treat your Visualforce markup as HTML4 ones.
The next improvement would help you to transition from Lightning markup to Javascript, as we've started to auto-complete the special shortcuts within attributes - yes, if you'd type "v." or "c." you will get the relevant suggestions from the IDE!
From a Javascript perspective, we've also added a couple handy features:
- first of all, it's again documentation, which is available in the code completion suggestions: while it's not needed all the time - sometimes it saves a huge amount of time when you can read a description in the editor and "find" the needed object or method, instead of searching this information in the web;
- as we've brought some handy information to the Code Completion, we've also removed some information - not relevant and not needed information; if being more precise, we've removed unusable in the given context of Aura items, so there'll be much fewer chances that when you have select some suggestion from the list, it won't compile on Salesforce;
- the last, but not least improvement in Javascript is that from now on, we are also expanding input parameters of controller's and renderer's functions for components, events, and helpers.
Small, but very handy new features for SalesforceDX
Ok, now let's meet our last-minute additions to The Welkin Suite Bloom R8 release - handy options to export and import data for SalesforceDX projects!
It's an absolutely cool feature of SFDX, that you can export your sample or testing data, store it in your repository, and deploy it to various Scratch Orgs - all is great about this, if you can remember the parameters, or where to find them in the documentation. In our own experience, we've got the idea that there are too mony other great and important things to remember, other than the format of commands, and the list of supported arguments. So now, in the Solution Explorer for SalesforceDX projects, you have the following options:
- When you right-click on any SOQL file there is an option to 'Export Data as a SObject Tree' - once you click on this, the IDE will execute the sfdx:data:export command with the given query for your default Scratch organization, and it will save the result in the same folder with the query.
- As you might have guessed - in the context menu for any json file there's an opposite command - 'Import SObject Tree Data' that imports the given json file to the default Scratch org. Please be aware, that this command is available for any json file in the project - we are not doing any additional checks to see if a selected file really contains the exported data.
With these small options, even when you are working to pass the Trailhead module, you will have two less commands that you need to remember. And as a great bonus - you even don't need to type the query itself - hope you remember about our great SOQL Builder!
Other changes
First of all, we'd like to say that we highly appreciate any and all feedback from our great users, who help us figuring out different issues! From our side we do our best to resolve them as quick as possible, so please don't hesitate to contact our friendly Customer Support if needed.
As we're talking about SFDX, we have also fixed a couple issues related to this functionality. Previously when you were creating a new Scratch Org by using the 'Set the created organization as the default' option as checked, the IDE was not handling this properly, and all the panels like Test Results, Logs, and Code Coverage were not being updated accordingly to the changed default organization. Another fixed SalesforceDX issue was also related to the Scratch Org creation process: the 'Next' button was disabled after selecting a project from the drop-down list for the 'Use from project' configuration option.
In a frame of our work on the newly implemented features for Workflow Rules, we have solved the issue when the information about these files was absent in the Admin panel, when you were adding them to your existing TWS project pulling from Salesforce. The same applies for Layouts data in the Admin panel. Another issue was related to the inability to deploy changes in Workflow Rules, due to the 'File has pending changes' error - for most cases, this issue is fixed now, however if you experience any problems with this functionality please let us know.
Also, our developers have worked on some issues related to the pull process. One of them is that the pull was failing if there were conflicts in a file version parameter for a file in your TWS project and this data on a Salesforce Organization - in this case, you could have been getting an error that the type of CollectionView did not support changes to its SourceCollection. Another issue related to 'meta.xml' files, consisted in an inability to resolve conflicts due to an error when clicking on the 'Resolve' button during the pull process - and this was fixed as well.
We have fixed an issue related to the impossible deployment validation against the production environment. This happened due to the disabled 'Rollback on error' setting for validations, while at the same time it is mandatory, so now the 'Rollback on error' option is checked by default for deployments and validations to production environments.
And for the end, we have left the improvement related to the project creation and pull processes. Sometimes there were issues related to an incorrect or corrupted zipped Static Resources that resulted in a failed project creation or pull process. As from now, the IDE doesn't block the project and allows you keep working with it, however the incorrect zipped files won't be included into a project, and TWS will try to redownload them on every pull. You will get an info message with a list of such files in these cases.
Dont' know why, but the children's story of "The Ant and the Grasshopper" comes to mind. If you know or don't know this story, the moral of it is something like work hard today so you can reap the benefits for tomorrow. So to that, we are happy to have worked hard to give you the benifits that should boost you into future, and we will continue to do our part to allow you to not just work hard, but to work smart!
Please enjoy the new improvenemts and we are looking forward to any thoughts that you might have.
Your comment may be the first