Interceptors

amaneet
Kilo Contributor

Can somebody help me in building an interceptor in custom application? Any pointers please.

4 REPLIES 4

Chuck Tomasi
Tera Patron

Hi Amaneet,



You can definitely do this. Interceptors are used to help create new records according to your rules. Example: try creating a task from task.list and click the "New" button. It has a bunch of rules that ask "What type of task do you want to create?" I've also used them to ask people what type of change they want to create with several pre-populated fields and view defined.



If you can provide more detail about what you'd like to do, I can certainly help.


Thanks for your reply.



I want to use them for marketing application asking the users what type of


event they want to create. Will have three options and based upon the value


the form will have different fields .



Is it possible?




On Mon, 16 Jan 2017 at 6:42 PM, ctomasi <community-no-reply@servicenow.com>


Yes, you can pre-populate fields using the sysparm_query parameter on the URL.



Create an interceptor for your table, create the related list entries for the options you want to present, then pass a URL like something like this:



x_marketing_events.do?sys_id=-1&sysparm_query=type=wedding&size=100



Navigating by URL - ServiceNow Wiki



The task interceptor makes a good example to follow.


Sangee
Giga Contributor

How can I add Interceptor inside another interceptor ?

Any kind of suggestion is appreciable.

Thanks.