Objective
After reading this section, you will learn how to install and use the Youreka Template Versioning Extension Pack.
Before you get started
These articles might be helpful before you read further:
Extension Packs are solutions that help accelerate the Youreka implementation process. This Pack includes Salesforce automation to allow versioning of Form Templates and Questions. With this package, you can see a hierarchy of Form Templates, identify where questions have changed over time, expose any outstanding Forms for deactivated Form Templates, update Youreka Buttons and more!
What is in the Package?
- 2 Lightning Pages
- 6 Salesforce Flows
- 11 Fields (6 on the Form Template object, 5 on the Question object)
- 1 Lighting Web Component
- 1 Apex Classes with Test Classes
Installing the Package
*Requirements: Be sure to have the most recent Youreka package installed from the AppExchange.*
The Extension Pack can be installed in a production or sandbox environment. Here are the installation links:
Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t8X000000MmSj
Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t8X000000MmSj
Please install for all users or the profiles who will be reviewing templates and question versioning.
Configuration
Once you have completed install, we will need to activate two page layouts. Start by navigating to Salesforce Setup, search for Lightning App Builder and edit the Form Template Version Record Page and the Question Version Record Page:
We will want to activate each page for any users leveraging this tool. Here is an example of activating these pages as the org default and saving:
That is it for setup. The solution will just fire in the background using Salesforce Flows as you author new templates and publish!
Optionally, you can add the new fields on the Form Template page and Question page layout, but it is not required. This list of fields is at the bottom of the article.
How it Works
We are leveraging all of the out of the box versioning in Youreka and layering Salesforce automation on top of it. So versioning will happen when you Publish a Form Template and when you Copy for a New Version like you may already be doing.
When you Publish a Form Template, we give the Template and Questions a Version Number if there is not one already from a prior version. We also push today’s date into the Template Start Date and stamp this template’s record id as the Original Version Id. This will be copied into any versions down the road so we can build a hierarchy. More to come on that in a minute, but here is how you can publish a Form Template:
Copy for a New Version
When you are ready to create a new version, you can use the Copy for a New Version action on the Form Template. Copying the template brings in all of the old version field values, sections, questions and more. This versioning package will give the new Template a new Version Number, add that number to its name and fill in the Parent Form Template field with the old version to help us build the hierarchy. You can edit the name if you’d like to remove the version number or leave it with the new revision number as is.
The Version Hierarchy
On the Form Template, the third tab will show a Version Hierarchy. You can expand levels to show a tree of the related Form Templates and their versions:
When publishing new versions, something to keep in mind is what to do with the old versions. For example, you may want to deactivate the old template. This will allow users to submit existing Forms tied to that Form Template, but will not allow them to create new Forms from that old template.
When setting a Form Template to Inactive, this versioning package will provide an end date for the template and identify the number of outstanding forms that have not yet been submitted at that moment in time. Below is an example:
Do keep in mind, that deleting Form Templates in the middle of the hierarchy will break the visual hierarchy, but all records above and below will still exist. If this happens, you can reparent the separated child Form Template by looking up its Parent Form Template field on the Form Template. Deleting the most recent Form Template at the end of the Hierarchy will not break the Hierarchy. You can always go up higher in the Hierarchy and Copy to a new child Form Template.
Questions and Question Hierarchy
This package also tracks any changes to Questions from one version to another.
When a Form Template is published, we not only version it, but we also version all of the related Questions. Additionally, after copying new versions of templates, each time a Question Label is changed or the Question Type is changed, we give that Question new version.
When a Question is created, it will take the version number of the template. So if a Question is created on the third version of a Form Template, the Question will start with 3.0 as the Question Version as well. Anywhere it changes down the road we will add increments of 1/100 and yield 3.01 and 3.02 etc. A Question Version of 3.02 indicates that the question was created from the 3rd version of the Form Template and has since changed twice.
Interested in seeing how a Question has changed from one version to the next? Well, you can simply review every Question Version by clicking into a Question. Then click the Question Versions tab. This will show every version of this Question across all related Templates and it will show if it had changed from one version to the next.
How are we doing it? Good question! Some background context might help here: When a Question Label is changed or when the Question Type had changed, we will tick a checkbox on the question called isChanged so you can easily see when a question had changed. In the example below, this Question is used three times across three versions of the Form Template. The Question Label was only changed once from version one to two, so we check that box on the second Question record. That Question was copied into the third Template Version and not changed. You can visually see how the label changed from version 1 to 1.01:
Ever wonder what all has changed in this Form Template version? Well you can do this very easily by clicking on the Questions tab from a Form Template. The Version Number field will show when each Question was created and the isChanged field will show if an older Question had been changed in this version.
In the example below, this is our second version of the Form Template. We have clicked on the Questions tab and it is showing that this Template has three Questions. The first two were created in the first version because their version number starts with 1. The second Question was changed in this version so the isChanged flag has been checked and it has a version number of 1.01, meaning that it was only changed one time since the Question was originally published on the first version. The third question has a version of 2, meaning that it was created in this Form Template’s version, while the other two Questions were originally created in the first Form Template:
Mobile Button Updates
The Mobile Button Updates tab can be a helpful tool in the event that you have created buttons on Youreka Mobile or Salesforce Buttons/Links that refer to the old version of a Form Template Id. This utility will walk you through and identify if there are any Youreka Mobile buttons with the Parent Form Template Id in those buttons. You can walk through the flow to update those buttons.
At the end, it will offer to update any Salesforce Buttons and Links as well. This is optional, but it will substitute the Parent Form Template Id with the new Form Template you’ve created. The screen will refresh and show Youreka Mobile buttons with this Form Template Id now.
That is it. Give yourself a pat on the back then test it out. Please let us know if you have any questions.
Supplemental information about the new Fields and Flows
New Fields
Here are the new fields that will be auto filled when versioning. You can edit these fields or use them however you’d like:
On the Form Template object:
Parent Form Template - When creating a copy of a template, this value is filled in with the original Form Template. This helps us understand the relationship of related Form Templates.
Original Version Id - We are tracking the original Form Template Id here. This is the most parent Form Template when we have created multiple versions and it is copied down to new revisions.
Open Forms for Inactive Template - When we deactivate a Form Template, this field is updated with any forms that have not been submitted for that Form Template.
Template Start Date - When we publish a Form Template, we stamp down today’s date in this field.
Template End Date - When we mark a Form Template as inactive, we stamp down that day’s date.
Version Number - This is where we track each revision when a copy is made.
On the Question object:
isChanged - this field is ticked when a question Label is changed or the type of question is changed.
Original Version Id - We are tracking the original Question Id here. As we create new revisions of the Form Template and question, this allows us to find all related questions to the one you are on.
Template Link - A clickable hyperlink formula field used in the Question Hierarchy.
Version Number - This is where we track each question revision when a copy is made or when it is edited.
Template Status - This is a formula field displaying the Form Template Status. This is displayed in the Question Hierarchy.
Flows
This automation is built using Salesforce Flows. Should you ever want to modify or deactivate any of these flows, they are available for your changes and can be located under Flows in Salesforce Setup. Here are their names with a brief explanation:
Form_Template_Versioning - This version's Form Templates with numbers and names and versions questions when copying and publishing a template.
Question_Versioning - This version's questions when they are edited.
Version_Hierarchy - This is the screen flow that displays the Form Template hierarchy.
Display_Question_Versions - This is a screen flow displaying all versions of the question you are on.
Count_Open_Forms_When_Deactivating_Template - This counts the number of forms that have not been completed for a Form Template that is no longer active.
Change_Button_Record_Ids - This helps change out the old Form Template Ids in Mobile buttons and Salesforce buttons to the new Form Template Id being authored.
Comments
0 comments
Please sign in to leave a comment.