Skip to main content
Solved

How to combine multiple records in a business event notification?

  • 29 September 2023
  • 3 replies
  • 346 views

Hello,

We have a business event that needs to send out email notifications when an inventory item reaches a certain age. The email should have all the items listed together - as opposed to sending out multiple emails. 

I currently have this business event set up:

Business Event
 
Fields to Track
Email Subscription

As of now, if more than one row is inserted, it only adds one out of the two items to the email subscription. I’ve even tried adding multiple datafields to the table (as shown below) but it does not work. 

The expected Result should be something like this:

Expected Result

How can I achieve this? I appreciate any help or advice you can offer, thank you!

@Naveen Boga@lauraj46@darylbowman@kandybeatty49 - any ideas on how I can achieve this? thank you in advance! 

3 replies

Userlevel 4
Badge

Hi @kanupindi 

I’m not sure if there’s an easier way to do this, but here is how I have accomplished this in the past.

Once you create your table in the Email Template, display the message body in HTML.  Look for the tr tag for the row that will hold your data records and add ‘data-foreach-view=""’:

 

 

 

From what I can tell, this will make Acumatica loop through all the records passed to the Email Template and generate table rows for each one:

 

 

I don’t know if there’s a way to do this that does not involve manually editing HTML, but this works.

Userlevel 4
Badge

Hi @stephenbologna39 , thank you!! I will test this out and let you know! 

Userlevel 2
Badge

Hello @kanupindi  @stephenbologna39 

I have a similar scenario, where I have the table in Email Template here I need to check If condition, When the order quantity exceeds 0, I should present the corresponding data in tabular form. Conversely, if the quantity is less than or equal to 0, it should be displayed within a second table. Please refer below screen shots.

I have tried below, I am unable to declare the If statement in code.

Could you please help on this.

Thanks in Advance.

 

Reply