I've noticed some odd behaviour when applying custom scripts via the On Form Submit consitions.
For example, I'm trying to configure a Service Catalog item. In this particular one, the Subject line is locked so that the requester cannot change it.
When they complete the form, they have several fields to fill, one of which is "Cost Centre to Charge"
The SC item has a default subject line of "New Purchase Request". I have added the following rule under "On Form Submit" so that when this field has been selected and the form submitted, it will add the contents of "Cost centre..." to the end of the subject line.
The script it executes is as follows:
The expected result for the above should be "New Purchase Request ABCD"
However, upon submitting, I get :
So the Cost centre is added twice.
As you can see, I've also tried adding a simple alert of "hello". It's commented out in the script above, but if I enable it, I see this twice even though it should only appear once according to the script. So it would seem the script is executing twice when the requester submits the form.
Is there anyway this can be prevented, perhaps by modifying the script?