- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 08:22 AM
Good morning developers,
I'm looking for some guidance on an email notification.
The background information is that whenever a new customer order is submitted, it sends out a notification to the Billing Department to approve the order. That part works fine. But I just received a new requirement that the Billing Department only needs to receive a notification on new orders if their customer classification is public.
The part that I'm having trouble with is that the customer classification is public comes in on the order as a product characteristic value, which is on a separate table. It's still associated with the order but it's not on the customer order table to where I can dot-walk it down, so I had to write a script. Even with my script, an email notification is still being sent out when the customer classification characteristic value is empty. I only need to send the notification out if the customer classification is public.
Can someone guide me on what I'm doing wrong with this script?
Here's the script that I'm using:
var exp = new GlideRecord("sn_ind_tmt_orm_order_characteristic_value");
exp.addEncodedQuery('characteristic_option_value=Public');
exp.query();
if(exp.next()){
answer = true;
}
else{
answer = false;
}
And here's the full email notification:
Any help will be greatly appreciated!
Best regards,
cnharris1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 10:09 AM
Just in case this helps someone else, but I was able to build the notification from the sn_ind_tmt_orm_order_characteristic_value table and filter out the customer classification is Public without scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 10:09 AM
Just in case this helps someone else, but I was able to build the notification from the sn_ind_tmt_orm_order_characteristic_value table and filter out the customer classification is Public without scripting.