Hello. I want to send notification when Picking Ti...
# suitescript
b
Hello. I want to send notification when Picking Ticket is Printed on Sales Order. When we click "Print Picking Ticket" I can see that no UE script runs. Also I can see there is a search filter named "Print Pricing Ticket" and when we print Picking Ticket, there is a system note that field "Print Picking Ticket" changes from "F" to "T". But as I said no UE script runs, and when we try to get value, it doesn't work. How could I send notification when Print Picking Ticket is clicked or Picking Ticket is printed? Any help would be appreciated
n
A UE doesn't run with the context type of PRINT? If not, you may have to hide the native button and add a custom one. Alternatively, have a scheduled or map/reduce script that looks for the "Print Picking Ticket" "T" and employ a custom field to say you've sent the notification so it doesn't keep sending the same notifications. You mean "email" when you say "notification" right? Alternatively there may be a some native config/setup that will send an email on picking ticket print but I'm not aware of it...
r
Adding one point to the above, Since the suggestion to go with a scheduler, with the below approach you will have to create any other custom fields. You can just search on system notes to see how many sales orders this check boxed gets ticked in last 24 hrs and send the email. I am assuming this field comes in system notes though.
b
@raghav how could I create a search on system notes?
n
@raghav I think you mean "not have to" not "not able to". @Boris Yasen It's no different to any other search really, if you navigate to the system notes on a transaction you can see the fields you're interested in. Only problem with that approach is you're talking about notifying daily which may not be frequent enough for you.
r
Yeah my bad, thanks for correcting.
You can create search on sales order only. And add filter system notes field print.
b
yes I found that search @NElliott but I can't find any date field that finds latest changed SOs
Is this one works?
message has been deleted
n
You would marry up the name of the field, the value being set to T and the created date of the system note not the transaction. @raghav is correct though you could access the system note as a join to the SO.
r
Search on transaction Filters Type sales order System notes filed printed ticket checkbox System notes date on or after yesterday System notes old value false System notes new value true.
n
You would need to be careful with that if your script ran at 6:30am and you had processed orders through the night you would pick up all todays transactions to that point too. I'd urge caution and use "is on" and not "is after"
Which means potentially processing some twice
b
Thank you @NElliott
👍 1
p
you could also create a custom field and set that field to true after the record has been processed. that way the record can not be processed twice
n
Yeah that was my first response ☺️
r
Unnecessary creating a custom field and then applying the logic for checking the checkbox especially on a transaction record, will increase the runtime of the schedule / map reduce script. If one can handle timezones and create the search properly, it's a more optimized solution. Customizing something has both pros and cons.
f
n
Using a checkbox is arguably more robust. The runtime impact is likely negligible unless you're talking hundreds of thousands of records. You just include a check for the checkbox not being set in the GID section of a M/R search and in the MAP submit field value to set itafterwards. If you're talking large volumes a scheduled is likely lacking governance to be used too. Relying on date and times in NS is fraught with gotchas imho.