Add current table check to UI Page 'attachment'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 02:04 AM
I'm trying to script a check on the current table/form in the 'attachment' UI Page. I've tried several different variations of the below but I don't seem to be able to get the current table check to work properly.
<j:if test="${jvar_current_table != 'sn_customerservice_case' && jvar_target_table == 'sn_customerservice_case'}" >
<div class="caption" style="color:red">
<p>Only want this text to show when the current table is NOT the Case table!</p>
</div>
</j:if>
The target table check works fine, but I can't seem to get the current table check to work correctly.
Why is this needed?
We have a custom association between the case table and the associated child/task tables and the portal, and only attachments added to the case table are displayed on the portal. As such we have a related list on child task tables which will add the attachment to the case table rather than the current table (as well as the usual attachment icon), but we need to add a message reinforcing to users that when they use the attachment button on that related list that it will be added to the parent case and not on the current table and will be visible to customers. As such we want to add the logical check of 'Target table for the attachment is the Case table (snc_customerservice_case) and the current table is not Case' so that we can display an informational/warning message only when the attachment button is clicked on a child task.
I thought this would be nice and straight forward but I've tried many different combinations of the above script with no success. Many thanks in advance for any assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 02:13 AM
Hi @SNAdmin47 ,
Why not disable attachment on the child tables and allow it only the main table.
There is an OOB Client script on the incident table which disables the attachment, (i.e., Hide attachment icon) when incident is closed.
You can leverage this feature and write the client scripts on the tables you don't want to and the agent would be adding on the parent table itself.
Reference client script:
---------.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=5601ea5f0a0a0b4b0055644e71c28968
If the above information helps you, kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 02:22 AM
Thanks for the response @Najmuddin Mohd ,
Unfortunately, that's not an option as the internal teams do sometimes need to attach things to the child task tables for internal communications/reference. For example, a network engineer might need to attach a screenshot as evidence and then pass the ticket to the windows team without it being exposed to the customer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 11:52 AM
In the same boat. Not sure where I can pass the "jvar_current_table" parameter in when the attachment icon is clicked and if I try to access "current" in the attachment UI page its null. Is there are way to access the parent page from the attachment UI page being used as a dialog?