g_form.getElement('it_group').options not working in service portal;

kamlesh kjmar
Mega Sage
Mega Sage

Hi,

pradeepksharma

I have a catalog client script that changes all the options of a field based on the selection in another field. Initially the script was using g_form.getElement('it_group').options; but now it's not working in SP. Below the script :-

var manuf=g_form.getElement('it_group').options;   // Extracts list of options in a drop-down field. ( This is not working in service portal )

for(i=0;i<manuf.length;i++)

options.push(manuf[i].value);

g_form.clearOptions('it_group');

g_form.addOption('it_group','',"-- None --");

for(i=0;i<options.length;i++)

if(options[i].indexOf('-'+loc)>=0||options[i].indexOf('-AMK')>0)

g_form.addOption('it_group',options[i],options[i]);

How to extract the list of options available in a drop-down field which should work in service portal.

1 REPLY 1

larstange
Mega Sage

Hi



There is no way to do this - it is not supported. Here is a list of supported g_form functions. You can only add, remove and clear options in a dropdown.


You need to rethink your design.



Service Portal Documentation