AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
Automation Notifica...
 
Notifications
Clear all

Questions Automation Notifications Conditions Tab

 
Everything Else
Last Post by Tim Rodman 8 years ago
9 Posts
2 Users
0 Reactions
2,789 Views
RSS
Paul
Posts: 18
 Paul
Topic starter
February 20, 2018 3:27 pm
(@pmccormack)
Eminent Member
Joined: 5 years ago

Tim, 

Is there a way to access the SOLine fields on the Automation Notification when the Sales Order is selected on that screen?
 
For example, when setting up a notification for Sales Order, I need to set a condition with the following:
Approved: checked
Status: Open
FreeItem: checked
ReasonCode: "Some Value"
 
The last 2 is not accessible via the Automation Notification Conditions because they are on the SOLine.
With only Approved: checked, and Status: Open, all items set off hold will send an email which is not ideal.
 
Is there a way to access the transaction item via the conditions without customization?
 
Thanks in advance.
 
--Paul

8 Replies
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
February 20, 2018 3:43 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hi Paul,

Not that I know of. But this would be a perfect situation for the new Business Events feature in Acumatica 2018 R1:

https://www.augforums.com/augforums/acumatica-generic-inquiries/new-acumatica-2018r1-feature-business-events/


Reply
Paul
 Paul
(@pmccormack)
Joined: 5 years ago

Eminent Member
Posts: 18
February 20, 2018 4:31 pm
Reply toTim RodmanTim Rodman

Thanks.

What I think I will do is tie into the Approval event and access Notification template to send the email.


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
February 21, 2018 6:10 pm
(@timrodman)
Famed Member
Joined: 10 years ago

With a customization right?

I should say that there is a way to loop through line records in the body of the email that gets generated. Especially useful for printing multiple tracking numbers on a shipment. I just don't think you can use line records to trigger conditions.


Reply
Paul
 Paul
(@pmccormack)
Joined: 5 years ago

Eminent Member
Posts: 18
February 21, 2018 9:39 pm
Reply toTim RodmanTim Rodman

Yes. I was able to hook into the approval status field updated handler, get a notification template and send the email. 

This works for my use case; sending an email to the owner after the approval is either rejected or approved. This prevents the email from being sent on every order that is set off hold.

 


Reply
Paul
Posts: 18
 Paul
Topic starter
February 22, 2018 9:19 am
(@pmccormack)
Eminent Member
Joined: 5 years ago

The only issue is on the notification template. All data field placeholders are not updated with the approval changes. Inside the event handler has the change; however, when the notification is parsed, it does not have the new values on the Approval object.(ex. ApprovedBy, Status, etc.).

So when the email is sent, only stale data is shown such as Status: Pending.

To get around that issue I send a separate notification based on approve/reject status. I don’t like it but will have to do for now until I figure out the race condition on those DataField  placeholders.

 


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
February 22, 2018 10:48 pm
(@timrodman)
Famed Member
Joined: 10 years ago

You do know about the Fields tab on the Automation Notifications () screen right?

 

When you list fields here, the notification only fires when a value in one of the fields listed changes.

It doesn't help with your FreeItem: checked, ReasonCode: "Some Value" logic needed on the lines. But it might help with only triggering when the Sales Order status changes.


Reply
Paul
 Paul
(@pmccormack)
Joined: 5 years ago

Eminent Member
Posts: 18
February 23, 2018 12:06 pm
Reply toTim RodmanTim Rodman

Yes. I have Status and Approved.

As you said it doesn't help with the items I need on the Sales Order.

Here is what's working for me for emails sent to the owner after the approval.
This prevents the email from being sent for orders which are not part of the workflow.

 


    protected void SOOrder_Status_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
    {
      SOOrder row = (SOOrder)e.Row;
      if (row != null)
      {
        if (row.Status == POOrderStatus.Voided) // Rejected.
        { 
          AddApprovalEmailActivity(row, EPApprovalStatus.Rejected);
        }
        else
        {
          if (row.Status == POOrderStatus.Open && row.Approved.HasValue && row.Approved.Value && HasApprovalWorkflow(row.NoteID))
          {
            AddApprovalEmailActivity(row, EPApprovalStatus.Approved);
          }
        }
      }
    }
      
    private bool HasApprovalWorkflow(Guid? orderNoteId)
    {
      var hasApprovalWorkflow = false;

      var approvals = PXSelect<EPApproval, Where<EPApproval.refNoteID, Equal<Required<EPApproval.refNoteID>>>>.Select(new PXGraph(), orderNoteId);

      return approvals.Any();
    }

Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
February 23, 2018 11:25 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Very cool. Thanks for sharing.


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 28 Online
  • 2,338 Members
Our newest member: Shoaib Shafquat
Latest Post: Pick List report suddenly not splitting on Shipment
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×