How will get invoice Number, Invoice Date in Email body in ax 2009

#static void sendEmail(LedgerJournalTrans parmLedgerJournalTrans)
#{

SysMailer mailer = new SysMailer();

SysEmailParameters parameters = SysEmailParameters::find();

str emailFrom = sysuserInfo::find(curUserId(),false).Email;

InteropPermission permission = new InteropPermission(InteropKind::ComInterop);

str _emailTo;

str _subject;

str _bodyText;

;

info(strfmt("%1", parmLedgerJournalTrans.AccountNum));

_emailTo = vendtable::find(parmLedgerJournalTrans.AccountNum).Email;//"svc.erp@happiestminds.com";

_subject = "Payment Notification ";

_bodyText = “Following payment is credited to your account –”+"\p" +“Invoice Number “+”\n” + parmLedgerJournalTrans.Invoice + “\n” + strfmt("%1", parmLedgerJournalTrans.amount());//“Aboutn Report”;

CodeAccessPermission::revertAssert();

permission.assert();

if (_emailTo != “”)

{

if (parameters.SMTPRelayServerName)

{

mailer.SMTPRelayServer(parameters.SMTPRelayServerName,

parameters.SMTPPortNumber,

parameters.SMTPUserName,

SysEmailParameters::password(),

parameters.NTLM);

}

else

{

mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,

parameters.SMTPPortNumber,

parameters.SMTPUserName,

SysEmailParameters::password(),

parameters.NTLM);

}

mailer.fromAddress(emailFrom);

mailer.tos().appendAddress(_emailTo);

mailer.subject(_subject);

mailer.htmlBody(_bodyText);

mailer.sendMail();

}

CodeAccessPermission::revertAssert();

I write above code but i am unable to get the Invoice Number ? How will get the Invoice Number in email Body ?please suggest ASAP?

Can you elaborate your problem? Does parmLedgerJournalTrans.Invoice has a value?

By the way, you can simplify your code with strFmt().

thanks reply ,
i tried this way also strfmt("%1",paramLedgerJournalTrans.invoice ) also . but still it is not getting and i am getting invoice amount correctly .
my question is where we can pick up the invoice details ( which table?). i am thinking only" ledgerJouranlTrans" only we we will get the invoice Number which we enter while done Invoice Journal …

Well, you really should get used top debugging your code. If parmLedgerJournalTrans.Invoice is empty, you can’t magically made up the invoice number.

If your problem is that you don’t know how to find the invoice number, forget your code for now and let’s focus on your actual problem. Where from are you trying to run your code and what data do you have on hand? Also, what kind of invoice are you talking about?