Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Widget clone - Could not save record because of a compile error

larsbowassini
Kilo Expert

I have made a clone of the "SC Categories" widget, but I can't save it because of an error in a part of the script I haven't changed. It's in the Client controller field:

find_real_file.png

I get the error "Missing name in function declaration" - but the original widget uses this code - so what can I do?

1 ACCEPTED SOLUTION

Arnoud Kooi
ServiceNow Employee

If you scroll down and click on the UI Action: "Open in Widget Editor"



find_real_file.png




You will be able to save it in the new window that opens.



find_real_file.png


View solution in original post

8 REPLIES 8

Arnoud Kooi
ServiceNow Employee

If you scroll down and click on the UI Action: "Open in Widget Editor"



find_real_file.png




You will be able to save it in the new window that opens.



find_real_file.png


This shouldn't be marked as a solution.   Maybe ServiceNow should fix their buggy code against their own validator!   As I've come across several widgets that have this problem when cloning.


I concur -- ServiceNow should fix these situations.   Apparently they are NOT 'new'.



Can you recommend how to solve this for clones of the "sc_categories" widget?     Below is a screen shot of the sc_categories widget which I cloned (along with many other customers...).   Both the Server script and the Client controller have errors.   When I edit my cloned version to add a semi-colon ";" to the end of line 6 in the Service script, that resolves that erro.   but I haven't been able to figure out how to resolve the remaining errors   in the Client controller script.



I'm learning as I go -- my apologies if this is rudimentary.   Thanks in advance to you or anyone else who can help solve this permanently in my cloned widget!sc_categories widget.jpg


Hi Lisa,



As a workaround, You can open the required widget in widget editor and try cloning the widget from widget editor.



You will able to save the target widget without any error messages.