The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Executing a client script when attachment is added to incident table

JJ1
Kilo Guru

I have a requirement to set certain field values when an incident is saved with an attachment file of specific file name.I wrote   on submit client script which uses a script include   to query sys_attachment and return the values based on requirement.This works fine ,no issues faced.But I recently noticed that adding an attachment to incident doesn't need a save on incident which will not execute my on submit client script and thus it will not set the fields.Is it possible to make this on submit client script execute when an attachment is added to the incident form or make save action mandatory after adding the attachment?

6 REPLIES 6

Deepak Negi
Mega Sage
Mega Sage

There is a UI page "attachment" and then you can find the code for attachment button as below:


<input disabled="true" class="button" id="attachButton" type="submit"


  value="${gs.getMessage('Attach')}" onClick = 'return ABC()' />



and then you can define your function inside <script> tag of the same UI page.




Thanks


Deepak


Rahul Jain11
Kilo Guru

Hi Jeevan,



You can write an business rule on the sys_attachment table. Put your logic and update the related incident record from that BS rule itself.



Regards,


Rahul Jain