
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 04:43 AM
Hello Everyone,
I have a client script which i wanted to run on 2 tables like Incident & task table ?
How can i achieve this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 05:45 AM
Hi Abdul,
The Inherited functionality, alone, on a client script would be useful only if you would want that script to run all the extended tables of a base table.
However, since in your case, you want the script to run only on Incident and Catalog Task table, you can do the following:
1) Create the client script on the base table, i.e. TASK
2) Check the Inherited checkbox on the script
3) In the starting of the script, use the following condition to ensure that the script is running only on Incident and Catalog Task table and not on other inherited tables from the TASK table:
function onLoad() {
var table = g_form.getTableName();
if (table == 'incident' || table == 'sc_task')
{
//alert('Run my script');
//place your code here
}
}
This should work and will make this script run on only the Incident and the Catalog Task tables extended from Task. Let me know if it doesn't.
PS: Mark this answer as Correct if it solved your query or hit Like/Helpful depending upon the usefulness of the response.
Regards
Supriya Bisht

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 05:48 AM
Perfect...! Let me try and update you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 06:17 AM
Thanks Surpiya,
Its working as required
Just wanted to make sure is that a best practice to write a client script on Task table and make it inherited ? Just for my understanding ?
Regards,
Azeez
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 06:23 AM
Hi Abdul,
It should be fine to write the script on a base table if you want it to work on its extended tables as well, instead of writing the scripts separately on different tables.
If I have answered your question, could you please mark the answer as Correct so that it gets removed from the Unanswered list of questions.
Alternatively, if you have any further queries, please let me know.
Regards
Supriya Bisht
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 04:54 AM
Hello Abdul,
Please explain your requirement so that we can suggest you accordingly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 04:58 AM
I have a requirement for which i written a client script which is working fine that wrote on Incident table, i want the same functionality to run on Catalog task table too, so can i make a script dynamic to run on 2 tables ?>