I’m creating a BPM to send an email when QuoteHed.Quoted=TRUE and QuoteHed.PowerPoint_c=TRUE. This is working with Quote.Update, but not when completing the final task and marking it won sets Quoted=TRUE.
I did a trace, saw that Task.Update is being called, so I cloned what I did for Quote.Update, but the QuoteHed fields aren’t part of the Task data set.
How do I get those fields to evaluate?
I thought of a standard data directive on QuoteHed, but the email template in standard data directives doesn’t have access to the field variables (for CustID, Name, Amt, and QuoteNum).
I was looking at this a while back and couldn’t make it work either so we went a different direction. I should’ve asked here like you did, so let’s see if there is an answer out there now…
I’ve been messing around with this today some more. I was hoping I could set arguments / variables with a data directive, and use that to drive the email, but it doesn’t have the Customer ID or Name fields available in the QuoteHed row.
Could I do something with tags? Or invoking functions or a different BO?
I suppose I could do a dashboard, but I really don’t want to make the sales people have to check one more thing every day when an on-demand email or alert would be best.
To make sure I’m getting it - That code block sets variables from the QuoteHed that I can use in my condition and email widget blocks? I would add variables for QuoteHed.Quoted, QuoteHed.QuoteAmt, and Customer.CustID
Yes that is what I was thinking. If you store the information in BPM Variables, they should be available in your condition checking and email widget. You could also do this all in code… I assume the task is not longer marked as modified (!r.Unchanged()) in the POST directive though so you might have to tinker with it a bit. Good luck!
Hi Tanner - I got stuck modifying your code to add the variables from the QuoteHed and Customer tables, so I thought I’d try to get at the QuoteHed criteria via “Number of Rows in My Query”.
Seems Epicor doesn’t like joining the QuoteHed table to Task via Key1, which is a string in Task, but Int in QuoteHed. I get this error, but not sure how to to fix it:
There is at least one compilation error.
Update.Post.ReferralEmail.cs(120,143): error CS1061: ‘int’ does not contain a definition for ‘ToLowerInvariant’ and no accessible extension method ‘ToLowerInvariant’ accepting a first argument of type ‘int’ could be found (are you missing a using directive or an assembly reference?)
I just ran a test and I don’t see an issue in our environment (10.2.300.37) when creating just a BAQ with no tt table. FWIW I typically steer away from joining in memory tables to Epicor tables as it can cause performance issues (could be a bug as well). Try using the db tables for the join in the query. To get only the information for the related ttTask table, add it to the grid and then add filter criteria on the Erp.Task to select the correct record.