AnsweredAssumed Answered

Using "{foreach.." in Mail-Templates for custom modules

Question asked by Julian Menningen on Jul 24, 2015
Latest reply on Jul 29, 2015 by Dan Kallish
Hi Guys,

I'm using SugarCRM 7.5 Enterprise and am currently looking at it from a Studio perspective only. I was searching through the community and other pages for quite some time but didn't find any solution to it yet.

I've designed a custom module (a Request form). The user will have to fill in data and add line_items to it. (Similar to "Quoted_line_items" to opportunities). Then it will be sent through a workflow. That works so far. Also do I get all data from the request module itself.

Now I also want to display the data from the Subpanel:

mph_requests_lin_line_item_1*   Requests   One to Many   Line Items

-> Subpanel in Requests with several Line items in it.

In the Mail-Template I want to display the line items with the foreach function:



{foreach from=$mph_requests_lin_line_item_1 item="lin_line_item"}

{::future::mph_Requests::mph_requests_lin_line_item_1::quantity_c::}   x {::future::mph_Requests::mph_requests_lin_line_item_1::name::}



This always returns just the last item in the subpanel list.

As you might see, I'm lacking knowledge about the syntax for the "foreach" tag. So can anyone give me any hints?

Thanks and have a great weekend ahead.