Solved

Email Template from Opportunitie

  • 27 February 2024
  • 2 replies
  • 23 views

Userlevel 3
Badge +1

I would like to add an action to the Opportunity screen that would load an email template, populate the template with fields from the Opportunity.

The part I struggle with is how to load template X and have the fields populated in an email activity.

 

 

icon

Best answer by Zoltan Febert 27 February 2024, 16:49

View original

2 replies

Userlevel 3
Badge +1

Okay, I started with the above comment. it works, I was just thinking there was a more elegant way. Thanks!

Userlevel 6
Badge +3

You can get an email template like this:

var templateID = "your template ID";

var notification = PXSelect<Notification,
Where<Notification.notificationID, Equal<Required<Notification.notificationID>>>>
.Select(Base, templateID);

Once you have it, you can modify the body:

notification.Body = notification.Body.Replace("{YourField}", yourValue);

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved