Set alert message if the column fields are empty in multirow variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 02:21 AM
Hi Experts,
We have a requirement to alert user when he submits the catalog form with empty values in multirow variable set.
Thanks, Jay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 02:37 AM
Wouldn't it be better to make those variables/columns mandatory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 02:58 AM
Hi Muhammad,
Thanks for quick response.
As per the requirement we have autopopulated 5 rows with one column value filled-in, other 2 columns are mandatory fields. Here even without filling the data in other 2 columns, we are able submit the form, we need to restrict sending the data with empty fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 03:23 AM
Well, you might have to create onSubmit() Catalog Client Script which will check/validate for empty values. Something like below should work.
function onSubmit(){
var mrvsValueStr = g_form.getValue('<backend_name_of_mrvs_variable>');
var mrvs = JSON.parse(mrvsValueStr);
for(var i=0; i<mrvs.length; i++){
if(mrvs[i].<backend_name_of_role_owner_variable> == "" || mrvs[i].<backend_name_of_role_approvers_variable> == ""){
g_form.addErrorMessage('Some columns are missing in mrvs rows');
return false;
}
}
}
Also refer to below KB article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 11:11 AM
I understand this is an old post, but how about creating a hidden boolean is true , then auto sets to false when any mandatory variables are not empty.
This way one can configure based off the hidden variable.