
My company wants to set Dynamics AX 4.0 that any customer with a balance equal to or over $2500.00 and is past due by 30 days to send an email to them with the invoice. Can anyone either explain how to do this or give me a direction to research and resolve this task? I understand that there is some STMP work to do and also deals with Financials and maybe using AR --> Customer --> Balance and see what code is there, or the Transaction form. Sample logic or code I recieved is:
//checksum if order is oke.
salesTotals = SalesTotals::construct(salesTable, SalesUpdate::All);
salesTotals.calc();
totalBalance = BBaytFunction::ConvertDecimalValue2Real(salesOrder.get_GrossAmount());
salesTotal = salesTotals.totalBalance() + salesTotals.totalMarkup() + salesTotals.totalTaxAmount();
totalBalanceDelta = totalBalance - salesTotal;
if(totalBalanceDelta != 0)
{
Global::error(strfmt("SalesTotal mismatch on SalesId %1 Delta: %2 of Gross amount: %3", salesTable.SalesId, totalBalanceDelta, totalBalance));
}
Now I am very new to this product and am trying to get a better understanding. Any additional assistance or guidance to any help on this matter would be greatly appreciated.
Thanks!
*This post is locked for comments
I have the same question (0)Hi,
Have your partner setup the smtp part in AX or look for a code sample on this forum on the stmp class. You can either use a .net component or a com component which should be installed on the client. In your case I would use the default smtp (but I actually do not know the status in AX if it can be used or that it is just a checkbox 'send electronically'.). If you would need to code I would code for the .net smtp setup since you can run it on the server, which you most likely want to do.
The report: in AR there is a report 'open balance' I think. There you can take out the code on the open balance of the cusomer or in the form AR -> Customer Details form.
I think you make live even easier by just sending out an email with a default subject and a default body in which you state the open balance of the customer and the date the balance is measure. That will save you form sending and building + attaching a report.
Also remind that you should be aware that you never should send > 1000 open balances at once since you might get detected as spam. In that case use Exchange or other 'queue' for processing slowly your emails.
J.