クライアントスクリプトによるスクリプトインクルードの呼び出し

nakamura323
Kilo Guru

ウィジェットのクライアントスクリプトにて、スクリプトインクルードを呼び出し、スクリプトインクルード内でテーブルにレコードを挿入します。
・クライアントスクリプト

スクリーンショット 2024-08-14 164856.png

・スクリプトインクルード

スクリーンショット 2024-08-14 164939.png

 

しかし、実行後はUnhandled exception in GlideAjax.となってしまい、ザーバ側とクライアント側で通信ができていないようです。
原因は何でしょうか?

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

The error is caused by the GlideAjax not completing successfully - it's not called and/or doesn't return a value to the client script correctly.  You need to add a sysparm_name parameter to the client script to direct it to the correct function, with a unique name that is not a reserved word, so don't name the function 'get'.  Here is an excellent guide on the components of a GA call

https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet-updated/ta-p/2...