Nav 2016 Preview Report without Request Page

Standard

ReportREPORT.EXECUTE Runs a report in preview or processing only mode without running the request page. The function gets the request page parameter values as an input parameter string. This is the new reporting function added on 2015 version

Requirement : preview Sales invoice report without the request page

  •  Create New codeunit to generate the XML request string

  5

  • Run Codeunit and apply the filter on request page  > OK >Copy the message to text

1

XML string

2

  • Copy Message to text and replace parameter with %1

3

  • Create New Action on posted sales invoice page

4

  • Posted sales invoice page

6

Advertisements

Error when exporting budget to Excel – The call to member Add failed. Microsoft Office Excel returned the following message: That name is not valid.

Image

While exporting budget from nav 5.1 version system hit following error message

The call to member Add failed. Microsoft Office Excel returned the following message: That name is not valid.

Error

 

Error hitting on  report 82 Export Budget to Excel Line ExcelBuf.CreateRange(ColumnDimCode[i]) Line

This is the standard Nav 5.1  report  bug and Microsoft has already fixed this issue on 2009 version , the problem occurs when exporting a dimension code that contains blank space (or special characters) ,  check the screenshot

 

Error

Update the two lines to Nav 5.1  version object and export again.

 

How to save outlook attachments files from Navision ?

Standard

020713_1706_ReadingOutl1.jpgwe have one new requirement to read outlook from Navision

Details

User will send one text file. The text file will be on specific format, then program should read new mails from outlook and  download the file to a pacific place . Read the text file and creates item journals and posts it.

The main point program should download the attachment file, through outlook automation we can download the attachment .

Here is one example for downloading the  mail

Create the automation variables check the image

outlook automation

Outlook mail  Codeunit

IF ISCLEAR(outlookapplication) THEN
CREATE(outlookapplication,FALSE);
outlooknamespace:=outlookapplication.GetNamespace('MAPI');
outlooknamespace.Logon('Outlook','',TRUE,TRUE);
outlookMAPIFolder:=outlooknamespace.GetDefaultFolder(6);  //6 means inbox
outlookitems:=outlookMAPIFolder.Items;
Findcriteria:='[ReceivedTime]>'+Text001+FORMAT(TODAY-1)
+Text001+' AND [Unread] =true ';
outlookitems:=outlookMAPIFolder.Items.Restrict(Findcriteria);
I:=1;
endofloop:=outlookitems.Count;
WHILE I<=endofloop DO
BEGIN
outlookemail:=outlookitems.Item(I);
outlookAttachments:=outlookemail.Attachments;
AttCount:=outlookAttachments.Count ;
IF  AttCount>0 THEN
FOR K:=1 TO AttCount DO BEGIN
Path:='E:\Outlook Attachment path\'+outlookAttachments.Item(K).FileName;
outlookAttachments.Item(K).SaveAsFile(Path);
END;
I+=1;
END;

create one Outlook Attachment path folder and run the codeunit

now the codeuint will filter last two days  unread mails from outlook and all the attachment files will save to E:\Outlook Attachment path\  

you can download the object file from here

Tips

Find criteria we can use different conditions

eg: [ReceivedTime]>’18/08/13′ AND [Unread] =true  AND [Subject] = ‘item’

check the link

http://msdn.microsoft.com/en-us/library/office/aa210275%28v=office.11%29.aspx