Customer statement in NAV 2016 CU04.

EklundEklund Member Posts: 2
In connection with NAV 2016 I want to e-mail customer statement - I can choose to view account statements, PDF, e-mail, Excel and XML in the "Output Options". I choose e-mail but nothing happens, what am I doing wrong for nothing happens.

I want to send customer statement to one customer per. e-mail.

Answers

  • AndwianAndwian Member Posts: 627
    You must setup the SMTP Mail Setup before use it.
    Regards,
    Andwian
  • AndwianAndwian Member Posts: 627
    But I am failed to setup that too. Does anyone know how to setup the SMTP Mail Setup?
    Regards,
    Andwian
  • KishormKishorm Member Posts: 921
    The following link shows how to setup SMTP e-mail...

    https://msdn.microsoft.com/en-us/library/dn951539(v=nav.90).aspx
  • kathirav_mca@hotmail.comkathirav_mca@hotmail.com Member Posts: 1
    edited 2016-09-27
    This is a bug in NAV 2016 and it still exists with NAV 2016 CU11. There will be two variables in CAL Globals in that report. SupportedOutputMethod and ChosenOutputMethod. You need to use SupportedOutputMethod in the request page and rename the caption as Report Output. You can find the similar working code in Report 116 - Statement.

    Note this report works fine from object designer, it will have problem only running from report selections.

    Write the below code on

    Report Output - OnValidate()

    ShowPrintRemaining := (SupportedOutputMethod = SupportedOutputMethod::Email);

    CASE SupportedOutputMethod OF
    SupportedOutputMethod::Print:
    ChosenOutputMethod := CustomLayoutReporting.GetPrintOption;
    SupportedOutputMethod::Preview:
    ChosenOutputMethod := CustomLayoutReporting.GetPreviewOption;
    SupportedOutputMethod::PDF:
    ChosenOutputMethod := CustomLayoutReporting.GetPDFOption;
    SupportedOutputMethod::Email:
    ChosenOutputMethod := CustomLayoutReporting.GetEmailOption;
    SupportedOutputMethod::Excel:
    ChosenOutputMethod := CustomLayoutReporting.GetExcelOption;
    SupportedOutputMethod::XML:
    ChosenOutputMethod := CustomLayoutReporting.GetXMLOption;
    END;
    Kathiravan M
    ArcherPoint
  • jsl_dkjsl_dk Member Posts: 24
    Could you please explain
    You describe that semilar working code can be found in repport 116 -statement. But I believe that the report that doesn't work is 116??!!

    My 116 looks like the code you have above my version is 9.00.43987
  • peterlinnetpeterlinnet Member Posts: 8
    edited 2017-10-13
    Mailing the Customer Statement requires the setup of a "Document Layout" with an email address on the Customer in question (at least for NAV 2016) - "Document Layout"s are found in the Customer Group on the Navigate Tab on the Customer Page.

    I don't know why this was made in that way, but when processing the Statements for mailing, NAV runs through the function CU8800.RunReport which (for some unknown reason) in turn runs CU8800.RunReportWithCustomReportSelection with a blanked CustomReportSelection-record parameter. Now in CU8800.RunReportWithCustomReportSelection the statement EmailAddresses := CustomReportSelection."Send To Email"; is called (and for good reason, as you can set different e-mails for different document types), but if no "Document Layout" is setup for the Statement on the Customer, no Custom Report Selection will exist with an email address, and naturally the variable EmailAddresses will be blank. And a Statement for a blank email address obviously won't be mailed. (but it will be printed though if you selected Print Remaining on the request page).

    So try setting up the Document Layout for Customer Statement with an email address on the Customer in question - that worked for me.
Sign In or Register to comment.