Copy Change Request via URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 07:04 AM
Hi!
We've got an already worked on UI Action that copies change requests (not OOTB one) and there's this weird bug when we save the copied CR it'll always save it's type as Standard no matter what is the copied CR type is.
This is the UI Actions code:
function OnCopyChangeClick() {
var url = '';
url = "now/nav/ui/classic/params/target/change_request.do%3Fsys_id%3D-1%26sysparm_query%3Dchg_model%253d" + g_form.getValue('chg_model') + "%255etype%253d" + g_form.getValue('type') + "&change_id=" + g_form.getUniqueValue();
open(url, '_blank');
}
I have tried decoding it and "cleaning" it but something always seem to break, either the fields are populated to the type is showing as Standard ever BEFORE saving the form.
Do have any information on how to construct this kind of URI to serve the same purpose?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 07:13 AM
This part in your URL variable '
sys_id%3D-1
is for creating a new change request (blank CR) and this URL when opened must be opening a new CR with with Standard type as default value.
Is it opening correct change request? or you wanted to create a new change request only ?
If new CR from URL is expected then try to alert the value of (g_form.getValue('type')) and do check what is the default value for type is.
'
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 08:57 AM
Hi sushantmalsure,
Well the requirement is basically when ever that UI Action is clicked:
1. New window of a new CR record is opened
2. The new CR form with be populated with source CR (from where the UI Action was clicked)
3. When clicking 'Save' the new CR will be saved with pre-populated data
Now when is happening is all correct, a new window is opened, and the new record form is populated with source CR but when Clicking save, the CR is saved as Standard no matter what
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:02 AM
When you click on UI action and its opening a new change in new window, if you see desired change type selected and after save its changing the type to standard.
Then I believe issue is not with UI action but with something else.
Use system watcher (right click on type field and select watch 'type') before you click save.
This will show you what is changing the type to un-desired choice after submitting the form.
Now there can be many reasons for this to happen as per customisations done .
Regards,Sushant Malsure