最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Dynamics ax 2012 向 Infologs 邮件正文插入新行的方法 / Reading Infologs and Inserting new line for email body Dynamics ax 2012

网络文摘 William 217浏览 0评论

I have designed a feature where i need to send the executions logs of Batch on its completion via email, That part is done perfectly fine and emails starts coming, I have read the infologs and concatenate the two strings so i can make one big string of multiple infologs, i was using \n between two strings but when i call the email sending code and pass the string; The new lines are not coming to email. The format for sending email was HTML.

i came to know that for HTML format. White spaces such as line-breaks are suppressed in HTML; and we have to use tags like <p> or <br />.

I have also pasted sample code on how i am reading the infologs and added <br/> tag for line break.


 private str 5000 readInfoLog()  
 {  
   SysInfologEnumerator enumerator;  
   SysInfologMessageStruct msgStruct;  
   Exception exception;  
   str 5000 Message;  
   enumerator = SysInfologEnumerator::newData(infolog.copy(1,infologLine()));  
   while (enumerator.moveNext())  
   {  
   msgStruct = new SysInfologMessageStruct(enumerator.currentMessage());  
   exception = enumerator.currentException();  
   message = message + strFmt("Type: %1; Message: %2",  
   exception,  
   msgStruct.message()) + '<br /> ';  
   }  
   return Message;  
 }  

Thanks
Happy Daxing

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址