Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can I implement record copying functionality in a portal?

bonsai
Mega Sage

I would like to implement a function similar to copying an incident in a portal form widget.

I would like to use the field values ​​of the record currently being displayed and post them as the initial values ​​of the record producer.

Is this possible?

I think it would be possible if I could set dynamic initial values ​​for the record producer.

6 REPLIES 6

Pankaj kr
Kilo Sage

Hi @bonsai ,

 

As stated above by the experts, It is a customization.

But if you still want this to be feature for RITM/INCs, You need to create a custom widget> parse the content of current screen record  by getting the sys_id of that record and doing gliderecord into respective table> On that is done, you need to intialize variables with values of existing ticket and insert> You can add a info message after insert or redirect the user to new ticket for better experience.

 

If this helped you, please mark this as helpful and accepted.

Thanks,

Pankaj Kumar

bonsai
Mega Sage

I was trying to implement a record copy function by cloning a link button widget.

The requirements were as follows:

- Place the widget on a form page.

- When the widget is clicked, the value of the form's "test_A" field is retrieved, and the field value is pasted into the record producer variable "TEST_A" and displayed.

I tried setting the following code in the custom widget's client controller.

However, the record producer was displayed with no initial value set.

Does anyone know a better way to do this?

 

 var url = '/sp?id=test_catalog_item&sys_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx(sys_id)&TEST_A="test";
		alert(url);
		//$location.url(url);
		window.location.href = url;

 

The script content is slightly different from the requirements, but it is trying to set a string to TEST_A for testing purposes.
This doesn't work...