- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:01 PM
Hi,
I want to determine on catalog client script if the current item being viewed is either Requested Item or Catalog Item. This is because I want a consolidated script that will run on both Requested and Catalog items but with special handling to each of the mentioned types.
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:39 PM
Hi Pradeep Sharma,
I already found a way. Instead of using current, I have used g_form. So now, I can utilize the g_form.getTableName(). sc_req_item is the value being returned if current item is Requested Item. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:04 PM
Hi Dalton,
Can you give little more details what you mean if "current item being viewed is either requested item or catalog item".
Both the requested item and catalog item stored is on different table.
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:15 PM
Hi Pradeep Sharma,
Yes, they are stored on a different table. I have this Catalog Client Script that is applied on both Requested and Catalog items. I want to include different special handling to each of Request and Catalog items. Rather than creating additional catalog client scripts. I want to put all the codes in one client script. Below are the process:
Note:
1. On page load, apply general handling.
2. Determine if item is Requested or Catalog item
2.1 If item is Catalog item, apply function A.
2.2 If item is Requested item, apply function B.
I want a consolidated and clean script so that it could be managed easily by others. No need to handle lots of separate catalog scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:22 PM
I have found something. Maybe I could use something like current.getTableName() to know where the current record is associated to. But 'current' cannot be used in client scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 08:39 PM
Hi Pradeep Sharma,
I already found a way. Instead of using current, I have used g_form. So now, I can utilize the g_form.getTableName(). sc_req_item is the value being returned if current item is Requested Item. Thanks!