attachment.uploaded event triggering and subsequent scripting

verdakosnett
Tera Expert

I have form on which i track who uploaded what attachment as in the screen capture below:

find_real_file.png

This works fine as long as the form is submitted but obviously it is no good if a user drags a file to the form. So, I registered an event as follows:

find_real_file.png

I then wrote a business rule:

find_real_file.png

and nothing happened....Where did I go wrong?

1 ACCEPTED SOLUTION

Yes as chuck mentioned, it should be an after BR. What is the field type of attachment_links and is it a custom field ?


View solution in original post

23 REPLIES 23

didn't work..


find_real_file.png


Abhinay Erra
Giga Sage

Can you show the when to run tab?


find_real_file.png


Abhinay,


Can you explain the "when" section of when to run a bit?


Many thanks for your always detailed and correct help.



Verda


The diagram on this page explains it pretty well.



http://wiki.servicenow.com/index.php?title=Business_Rules



Before rules are generally used to update fields on the current record before the data is committed to the database.


After rules are generally used to update related records after the commit is done.



If you try to update the current record in an after rule, the results aren't saved because the commit is already done. If you add current.update() you trigger the business rules all over again.



If you try to update related records in a before rule, you could be updating information and get out of sync of the current record is not updated accurately (e.g. have a bunch of canceled change approval when the change request still requires approval.)



Hope that helps.