- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Included in the Developer Toolbox Update Set available on Share (link to Share in the post).
I'm always trying to squeeze a little bit of extra productivity out of the platform everyday. This tool simply creates a new Module in the System Update Sets Application which allows you to open the Remote Instance directly where you can then retrieve completed Update Sets.
It just ends up saving you a mouse click, but hey, work smarter, not harder.
It's a Related Links UI Action that appears on the Remote Instance form:
Clicking OK will then create the new Module:
Here are the details for the UI Action:
Name: Create a Module for this Instance
Table: Remote Instance [sys_update_set_source]
Order: 100,000>
Action name: u_fpc_create_module_instance
Active: checked
Show update: checked
Client: checked
Form link: checked
Messages: u_fpc_create_module_instance.confirm
Hint: Create a link to this record in the Navigator (FPC)
Onclick: uFpcCreateModuleInstance();
Condition: gs.hasRole("admin")
Script:
//client function that runs 'onclick'
function uFpcCreateModuleInstance() {
if(confirm(getMessage("u_fpc_create_module_instance.confirm"))) {
gsftSubmit(null, g_form.getFormElement(), "u_fpc_create_module_instance"); //MUST call the 'Action name' set in this UI Action
}
}
//code that runs on server
//ensure call to server-side function with no browser errors
(function() {
if (typeof window != "undefined") {
//drop out if running in a browser
return;
}
//create a new Module record
var gr = new GlideRecord("sys_app_module");
gr.newRecord();
gr.u_fpc_preserve_during_clone = true; //field added by "Preserve During Clone" Update Set, if loaded
gr.title = gs.getMessage("u_fpc_create_module_instance.title.default", [current.getValue("name")]);
gr.name = "sys_update_set_source";
gr.order = 150;
gr.application.setDisplayValue("System Update Sets");
gr.link_type = "DETAIL";
//gr.image = "images/icons/update_source.gif";
gr.query = "sys_id=" + current.getValue("sys_id"); //Arguments field
var newId = gr.insert();
if (newId) {
gs.addInfoMessage(gs.getMessage("u_fpc_create_module_instance.created", [gr.getLink(), gr.getValue("title")]));
} else {
gs.addErrorMessage(gs.getMessage("u_fpc_developer_toolbox.message.error.unknown"));
}
//return back to this record
action.setRedirectURL(current);
})();
What I normally do during the initial implementation is create the Remote Instance records for all the instances, create a module for them all and then deactivate the ones we would not be pulling in Update Sets into production from. Once you clone down to your sub-production instances, set the Active field on the appropriate Modules.
So if you have a total of 3 instances, production, test and dev, you would have the following 2 modules:
- Update Source - dev
- Update Source - test
The "Update Source - dev" Module would only be active in the test instance so you can perform the first pull of your Updates Sets and the "Update Source - test" Module would only be active in the production instance so you can pull them into that one. The dev instance would not need any of the Modules to be active because you would not be pulling in any Update Sets from another instance.
I then add a Clone Data Preserver which keeps the proper Modules active in your sub-production instances. This is how I set it up:
I've attached the XML files for the UI Action, UI Messages and Clone Data Preserver.
As always, try it out in your company's development instance first, or better yet, your own personal development instance.
- 511 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.