Need help to make field mandatory in multirow variable set

sunil7
Giga Expert

Hi Everyone , I have a requirement on catalog item , we have two variable and a multirow variable set(Test1) on catalog item. Our requirement is when we select 1 in first variable (Copier paper) and 2 in second variable (Pens) then Field1 inside multirow variable set should become mandatory. Please see screenshot below

find_real_file.png

 

find_real_file.png

15 REPLIES 15

Try doing an alert on the onload, and check the value you get from them in your variable set client script:

alert(store_gform_value.g_form.getValue('pens')); and show the result

 

Also make sure your variables (copier_reams & pens) have "include node" to true 🙂

 

 


Best regards,
Sebastian Laursen

I applied this alert(store_gform_value.g_form.getValue('pens')); but not getting any popup. also I checked (copier_reams & pens) have include none as true

Okay, there should be a pop up in the portal. Try with just "alert('test');" and when you click on "add" it should come, once the multi row is loaded. If not there is something wrong in how it is setup. And just to make sure, the variable set should be on the catalog item =D 


Best regards,
Sebastian Laursen

Hi Sebastian,

Thanks for your help but the problem was inside {g_form: g_form} global variable ..It is not working..I got the solution in another way using g_service_catalog.parent.getValue() method and its working as expected

Ah yes can see they have added this api now. I've edited the first answer with this as well. The other solutio is also working, as clearly shown in my example, but if in release Quebec or later this is the way: https://developer.servicenow.com/dev.do#!/reference/api/rome/client/g_service_catalogClientAPI

Best regards,
Sebastian Laursen