g_form.geFieldNames() not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 02:40 AM
I am using catalog client script on submit as below
var allFields = g_form.getFieldNames();
for(var fieldName in allFields){
alert( allFields[fieldName]);
}
it is not working and not allowing to submit the form.
is g_form.getFieldNames() is deprecated? If yes any other way to get all variables shown on the form to get populated in client script ?
We like to send notification with variables only variables shown on the form even user didnt provide info in those variables. hidden variables through UI script shouldnt be sent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 04:54 AM
Yes I agree if its hidden its not ahve value. but even varaibles on the form is not filled by users but we need that in the notification as it is shown to the users and it is intentionally not filled by user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 04:58 AM
just confirming, you are saying you want to send empty variables to target user to notify these variables value has not filled ? if this is the scenario then reverse the if block condition in the above script
check for =='' instead of !=''
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 05:06 AM
Sorry, just to clarify we want variable need to be sent to users if it is shown on the form even it is filled or not filled.
It should not send any variables which are not shown to users including UI policy hidden variables.
Ideally it should replicate what user saw while submitting service request.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 05:36 AM
OOTB , i don't think any glide form API method will give you these details.
adding one thread here, kindly have a look. see if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 05:51 AM
How to iterate all variables in the catalog item? isvisible will work if we pass variable name. but can you please tell how to iterate through all variables on the form?