We would like to email a list of Sales Orders that were created during the day using a Breaking/Routing rule to send the emails.
I am struggling to make this happen.
I added a Boolean UD field called OrderHed_SendOrdAckEmail_c and i created an autoprint that is triggered by the OrderHed_SendOrdAckEmail_c being changed from false to true. That works.
I then created a function that sets the OrderHed_SendOrdAckEmail_c to true and added that function to a schedule. That works with a hard coded sales order number.
I am struggling to find a way to set mutiple OrderHed_SendOrdAckEmail_c based on a query of orders sent that day.
Has anyone done anything like this?
I thought i was close wrote some custom code in the function to set the OrderHed_SendOrdAckEmail_c however, i could not get the code to check syntax - errro on Db.Validate(); I then tried the Db.SaveChanges(); however, when i run the function i get an error.
Why would you not just use a report that has a filter on it for Order Date, and schedule it dynamically, for example, put it on a schedule at 12:30am and set the filter to “yesterday”? No need for UD fields or functions.
a data directive on the Print Checkbox, which creates a print task (including routing rule with email) in a process set. We schedule the process set at night. with a bpm on the systask table we remove a successful print from the process set.
Ms. @aosemwengie1: @Hally has it right - my intention is to use the UD field as an “Emailed already” flag so we do not send the same OrderAck twice.
Ms. @aosemwengie1: I must confess i “Simplified the description here”.
In actual practice we need to look at all of the shipments made for the day - filter by Pack Slip Shipped flag = true, lookup the Sales order and if the email has NOT been sent before AND there is an assigned customer contact valid email address (another UD field i added) THEN send the email.
I had something similar at my previous job (I had used the AutoPrintReady field) because ours had to have attachments along with the acknowledgement, but the attachment file had to be dynamic based on the PartNum and Customer.
Mr. @kve : Please excuse my script kiddie understanding. I am having trouble getting the function to “Check Syntax”. It is saying the namespace SalesOrderSvcContract could not be found.
I tried adding a Usings of “Erp.Contracts.SalesOrderSvcContract” however that does not seem to help the error.
So to get that added, exit the Code Editor (it will ask you if you want to save with an error, you can say yes). Go to the tab on the library labeled “References” and the sub-tab “Services”, click Add. Find the service called “SalesOrder” and double click.
If it still throws the error, change the call service line to below: