getControl is not supported in service-portal

Mohammad Danis1
Giga Guru

I could see getControl is not supported in service-portal what we can use instead?

 

I am writing a client script to not to allow copy and paste in a catalog field.

for that I have written a client script:

eg:

 

var getField = g_fom.getControl('variable name');

getField.onpaste = function(e)

{

e.preventDefault();

};

}

 

it is working in classic view but not in service-portal. 

 

can anyone please advice!!

 

Thanks in advance!!

 

Regards,

Mohammad Danish

4 REPLIES 4

Akash4
Kilo Sage
Kilo Sage

Hi Danish,

You may have a look in to a scenario, insights in this link may help you.

Link - getControl in Service Portals

Regards, Akash

Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

No, I tried this yesterday itself its not working  as g_form.hasField() will return true/false and nothing else possible. 🙂

 

Trupti6
Tera Expert

Hi,

Check below link,

 

https://hi.service-now.com/kb_view.do?sysparm_article=KB0547171

 

Thanks,

Tripti S.

Hi Tripti,

 

I tried this also not working 🙂

 

Regards,

-Danish