Set mandatory fields inside MRVS for a specific field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 09:45 AM - edited ‎07-03-2025 12:48 PM
actually i have another issue that i need to set some mandatory fields inside that MRVS ,problem i'm facing that it worked when i remove the country condition cause the subject country exist in the catalog item and i guess it's not getting catched inside the modal of the MRVS what to do in the case cause i need to make them mandatory for a specific country
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 09:56 AM
Hi @GhitaB ,
is subject_country variable/field is reference type or choice type
just put an alert and check what value you are seeing if it is a reference type you have to compare with sysid
function onSubmit() {
var country = g_form.getValue('subject_country');
alert(country);
if (!country || country.toLowerCase() != 'australia')
return true;
var emergencyName = g_form.getValue('emergency_name');
var relationship = g_form.getValue('emergency_relationship');
var address = g_form.getValue('residential_address');
var eCountry = g_form.getValue('emergency_country');
var mobile = g_form.getValue('phone_mobile');
if (!emergencyName || !relationship || !address || !eCountry || !mobile) {
spModal.open({
title: "Missing Information",
message: "Please complete all required Emergency Contact fields before adding the row.",
buttons: [{
label: "OK",
primary: true
}]
});
return false;
}
return true;
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 10:16 AM - edited ‎07-03-2025 10:22 AM
Hi,
try using below: