Hey! We’re seeing a weird issue with one of our invoice email templates.
If we open the PDF preview and click Send, everything works and the email draft opens as expected. But if we’re on the Invoices screen (AR.30.10.00) and use the Email action, it fails every time with this error (Trace-Log):
at PX.Data.PXViewCollection.get_Item(String key) in C:\build\code_repo\NetTools\PX.Data\Graph\Collection.cs:line 1489 at PX.Data.Wiki.Parser.ParseContext.SetForeachIterator(String viewName, IDictionary2 parameters, String sortby) in C:\build\code_repo\NetTools\PX.Data\Wiki\Parser\Output\ParseContext.cs:line 123 at PX.Data.Wiki.Parser.ForeachTagProcessor.PX.Data.Wiki.Parser.PXHtmlParser.TagProcessor.Process(String tagName, String content, List1 attributes, WikiArticle result, PXWikiParserContext settings) in C:\build\code_repo\NetTools\PX.Data\Wiki\Parser\BlockParsers\XmlTags\ForeachTagProcessor.cs:line 115 at PX.Data.Wiki.Parser.PXHtmlParser.DoParse(ParseContext context, WikiArticle result) in C:\build\code_repo\NetTools\PX.Data\Wiki\Parser\BlockParsers\HtmlParser.cs:line 293 at PX.Data.Wiki.Parser.PXTemplateContentParser.DoParse(ParseContext context, WikiArticle result) in C:\build\code_repo\NetTools\PX.Data\Wiki\Parser\BlockParsers\TemplateContentParser.cs:line 221 at PX.Data.Wiki.Parser.PXTemplateContentParser.Process(String templateText, PXGraph graph, Type entityType, Object[] keys) in C:\build\code_repo\NetTools\PX.Data\Wiki\Parser\BlockParsers\TemplateContentParser.cs:line 143 at PX.Objects.EP.TemplateNotificationGenerator.ParseExpression(String field) at PX.Objects.EP.TemplateNotificationGenerator.CreateMessage() at PX.Objects.EP.NotificationGenerator.CreateMessages() at PX.Objects.EP.NotificationGenerator.Send() at PX.Objects.CR.Extensions.ActivityDetailsExt4.SendNotification[TTemplateEntityType](String sourceType, String notifications, Nullable1 branchID, IDictionary2 parameters, Boolean massProcess, IList1 attachments) at PX.Objects.AR.ARInvoiceEntry.<Notification>d__249.MoveNext() at PX.Data.PXAction1.<Press>d__39.MoveNext() in C:\build\code_repo\NetTools\PX.Data\Descriptor\Action\PXAction.cs:line 1297 at PX.Data.PXAction1.<Press>d__39.MoveNext() in C:\build\code_repo\NetTools\PX.Data\Descriptor\Action\PXAction.cs:line 1256 at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows) at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
Our template includes this block below. If i exclude it, the action works. This code seems to work for other customers in other instances, so I’m struggling to understand why it fails in this environment. Any ideas what could cause this difference? Do i miss something?
<div data-foreach-view="Transactions" style="display: flex; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid rgb(241, 243, 244); align-items: center;">
<div style="flex: 0 0 20%; text-align: left; font-weight: 600; color: rgb(7, 105, 168); font-size: 10pt; font-family: "Segoe UI"; padding: 0px 8px;"><span data-field="yes" style="text-decoration: none; color: inherit; background-color: transparent; border: none; font-style: normal; font-weight: normal; font-family: "Segoe UI";">((Transactions.InventoryID))</span></div>
<div style="flex: 1 1 60%; text-align: left; font-size: 10pt; color: rgb(0, 166, 221); font-family: "Segoe UI"; padding: 0px 8px;"><span data-field="yes" style="text-decoration: none; color: inherit; background-color: transparent; border: none; font-style: normal; font-weight: normal; font-family: "Segoe UI";">((Transactions.TranDesc))</span></div>
<div style="flex: 0 0 20%; text-align: right; font-weight: 600; color: rgb(0, 166, 221); font-size: 10pt; font-family: "Segoe UI"; padding: 0px 8px;"><span data-field="yes" style="text-decoration: none; color: inherit; background-color: transparent; border: none; font-style: normal; font-weight: normal; font-family: "Segoe UI";">((Transactions.Qty))</span> <span data-field="yes" style="text-decoration: none; color: inherit; background-color: transparent; border: none; font-style: normal; font-weight: normal; font-family: "Segoe UI";">((Transactions.UOM))</span></div>
</div>Thank you.