service portal copy button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 01:24 PM
Hello all,
I am struggling with a requirement, where there should be a button on the portal called copy record on the form view of any opened record
For Eg: assume I have opened change record in portal, on the change form we should be able to see a button called copy change and it should take all the current values and should populate to a new change rec once clicked with out submitting (exactly how we have copy change in the instance)
I have the button on the form just struggling with the server code , please help me resolve this.
Thank You

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:46 PM
There is an OOB UI action, which I think you can use to copy a change record.
If you want to build something similar, it should be something like
var myrec = new GlideRecord(current.sys_class_name);
myrec.newRecord();
myrec.field1 = current.field1;
myrec.field2 = current.field2;
var myrecsysid = myrec.insert();
myrec.get(myrecsysid);
action.setRedirectURL(myrec);
gs.addInfoMessage('Record has been cloned');
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:48 AM
hello Sanjiv Meher
myrec.newRecord(); this is redirecting me into the instance, the new from is not opening in the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 05:29 AM
Hello Ranjan,
Did you get the solution for your question?
I have same kind of requirement? not able to use existing functionality of copy request and copy incident for EC or Service Portal.
Please share if you have any direction for the same.
Regards,
Sonali Pawar