i want use g_form in widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 11:17 PM
In catelog item,i create a Custom with Label variable 。
Then create a html widget
Now i want to use g_form in widget Client Script.
How can i do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 11:46 PM
Hi @HUANGCONG ,
g_form does not work there, to get a value in a client controller you can use something like this:
$scope.$on("field.change", function(evt, parms) {
if (parms.field.name == 'your_field')
c.data.yourfield = parms.newValue;
});
Or refer to these links :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 12:23 AM
Hi,
"g_form" as a global object cannot be used in a widget client controller so its functions are not supported either. Please find below link for solution.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0715296
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Regards,
Prarthana Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 03:47 AM - edited 09-19-2024 03:50 AM