Can a UI Action trigger call a business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2008 03:16 AM
We have the need to copy an existing change request to create a new one. The copy is to include fields on the change request along with any associated task, configuration items, Affected CI's and attachments. Primary use will be to create reoccurring change request (something that happens weekly, bi weekly, etc.). Initially I am looking at 3 options. The first copies without dates (planned start, planned end, etc.) The second copies and sets the dates out 1 week (weekly change request) and 3rd set s the dates out two weeks (bi-weekly change request). Anything that is not weekly or bi-weekly uses the first and manually set the dates.
I could do this as 3 UI Actions (form context menu) but would have to duplicate some of the code in each UI Action. I prefer to handle this as a business rule with functions and use a parameter to determine which functions are called. Currently I have the first two started so they clone the change request and task. The two UI Actions write a value to a field on the change request and then updates the change request. This triggers the business rule and the value set in the field is the parameter that determines which functions to call. The preferred way would be for the UI Action call the business rule directly and pass it the needed parameter to eliminate the need to update the change request to trigger the business rule. Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2008 07:40 AM
Below is a script you can use in a UI Action of type button - this should copy contents of an existing Change Request into a new one. The nice thing about this is it will not actually create the record until you hit submit (sys_id=-1 dictates this):
gs.addInfoMessage("Change copied. Press submit to save");
action.setRedirectURL("change_request.do?sys_id=-1&sysparm_query=short_description=" +
current.short_description + "^category=" + current.category);
action.setReturnURL("change_request.do?sys_id=" + current.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2009 08:45 AM
eric.schroeder
I have created a similar button and this works fine for normal fields, but I would like to clone the related lists too (the approvers list in particular) Does anybody have an idea on how to do this?