Business rule is not working when image content type is inserting or updating in Attachment table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 10:58 PM
Hi All,
I have written a BR (before Insert/ Update ) on sys_attachment table to update image. But sometimes it is wprking sometimes not.
var kb = new GlideRecord('kb_knowledge');
kb.addQuery('sys_id', current.table_sys_id);
kb.query();
while (kb.next()) {
if (current.content_type == "image/png") {
current.table_name = "ZZ_YYkb_knowledge";
}
}
Thanks,
Sam
Labels:
- Labels:
-
Knowledge Management
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 12:50 AM
I would adjust the BR trigger to only check on insert/update where the table_name = kb_knowledge and content_type = image/png. That will already limit the BR triggering on other tables/types, which it currently does.
Then you only need to update the current.table_name and not query to the table.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark