To restrict attachment on incident from, once state is closed or resolved.

amit7828
Kilo Contributor

Hi All,

I want restrict users from attaching files on incident form, once incident is closed or resolved.

Kindly suggest on this.

1 ACCEPTED SOLUTION
3 REPLIES 3

vinitha3
Tera Guru

Onload client script of the form,



function onLoad() 
{ var strVal = "javascript:saveAttachment('incident', '');";
var arrLink = document.getElementsByTagName('a');
var intLen = arrLink.length;  
for (var intCnt = 0; intCnt < intLen; intCnt++)
{ strAttrib = arrLink[intCnt].getAttribute &&
arrLink[intCnt].getAttribute('href');  
if (strAttrib == strVal) { arrLink[intCnt].style.display = 'none'; } } }

In case the script does not work, try the alternative approach provided below.


function onLoad() 
{ var refs = document.getElementsByTagName("a");
if (refs)
{ for (var i=0; i < refs.length; i++)
{ var ref = refs[i]; var inner = ref.innerHTML;
if (inner.indexOf("attachment.gifx") > 0)
{
ref.style.display = 'none'; } } } }

Thanks,
Vinitha.K


Alikutty A
Tera Sage

Hi,



Please refer to To restrict attachment on incident from, once state is closed or resolved.



The same topic is being discussed.



You can write an onload client script to validate the state and add this code



if(g_form.getValue('state') == 3 || g_form.getValue('state') == 6){


  g_form.disableAttachments();


}



3 - Closed


6 - Resolved



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response