I'm trying to send an email using the {executeFunction:emailNotification} for the Message body.
This is an Xbasic function.
The code runs and an email is sent, but the email is empty. I ran debug(1) and the I get the message
"Property not found e.rtc.e.repeatingSectionInfo[1] subelement not found".
The error source is highlighted in red in the attached code. I think I know what's happening, but I'm not
sure and I have no idea how to fix the problem. I've searched the board and found similar posts, but I do not
understand what was done to solve the problem.
Thanks
This is an Xbasic function.
The code runs and an email is sent, but the email is empty. I ran debug(1) and the I get the message
"Property not found e.rtc.e.repeatingSectionInfo[1] subelement not found".
The error source is highlighted in red in the attached code. I think I know what's happening, but I'm not
sure and I have no idea how to fix the problem. I've searched the board and found similar posts, but I do not
understand what was done to solve the problem.
Code:
function emailNotification as c (e as p) 'emailNotification = "javascript commands to be executed in the Browser." debug(1) dim site as c dim orderedby as c dim tail as c dim vendor as c dim terms as c dim refnumber as c dim notes as c site = e.rtc.e.dataSubmitted.SITE orderedby = e.rtc.e.dataSubmitted.ORDEREDBY tail = e.rtc.e.dataSubmitted.TAIL vendor = e.rtc.e.dataSubmitted.VENDOR terms = e.rtc.e.dataSubmitted.TERMS refnumber = e.rtc.e.dataSubmitted.MYPO notes = e.rtc.e.dataSubmitted.NOTES dim message1 as c = "" message1 = message1 + "Site: " + site + "<br/>" message1 = message1 + "Ordered by: " + orderedby + "<br/>" message1 = message1 + "For: " + tail + "<br/>" message1 = message1 + "Vendor: " + vendor + "<br/>" message1 = message1 + "Terms: " + terms + "<br/>" message1 = message1 + "Ref #: " + refnumber + "<br/>" message1 = message1 + "Notes: " + notes + "<br/>" dim message2 as c = "" dim part as c dim Exchange as c dim Price as n message2 = <<%STR% <table> <tr> <th>Part Number</th> <th>Price</th> <th>Type</th> </tr> %STR% dim vRows as c [COLOR="#FF0000"]vRows = e.rtc.e.repeatingSectionInfo[1].visibleRows[/COLOR] p = *string_to_array(vRows) dim numRows as n numRows = p.size() for i = 1 to numRows Part = eval(w_upper("e.rtc.e.datasubmitted.part") + p[i]) price = eval("e.rtc.e.dataSubmitted.PRICE" + p[i]) Exchange = eval("e.rtc.e.dataSubmitted.EXCHANGE" + p[i]) message2 = message2 + "<tr><td>" + part + "</td>" message2 = message2 + "<td>" + price + "</td></tr>" message2 = message2 + "<td>" + exchange +"</td>" next message2 = message2 + "</table>" emailRequest = message1 + message2 end function