Thursday, May 28, 2015

Obtaining Input Without Form


Hi,

Sometimes you don't want to use an entire form to get user input. In this case, we use dialog box window before opening the main form to give input and according to given input we can open form. As we know dialog boxes are not a substitute for forms, but they work just fine for quick input to our form.

Now I am going to implement a simple form as our requirement that open a window before opening the main form to take input.

1) Create a new form named "Input Window Before Main Form" and select some fields according to you. You can also use another name.

2) Form Designer look like this...


3) Add the following global variables...
Name DataType Subtype Length
Window Dialog
DocumentType Option
DocumentNo Code 20

Note: Remember that "DocumentType" is an option datatype. So use the correct option. Select the DocumentType and press "SHIFT+F4" to go to its properties and under the "OptionString" properties write the correct value.

4) Add the Text Constants...
Name ConstValue
Text001 Document Type: #1############# \Document No.:  #2#############

5) Now write the following code to the "OnOpenForm" trigger of the form...
Window.OPEN(Text001);
Window.INPUT(1,DocumentType);
Window.INPUT(2,DocumentNo);
Window.CLOSE;

SETRANGE("Document Type",DocumentType);
SETRANGE("No.",DocumentNo);

6) Now save and close the form and run. When you run your form then "Input Window" will open first.


7) After giving the input press Enter or click Cancel to exit.



Thanks & Regards
Niraj Kumar

http://niraj-msnav.blogspot.com
http://nirajdynamicsnav.wordpress.com

    

Wednesday, May 27, 2015

Problem in cumulative update 19 for Microsoft Dynamics NAV 2013R2

Problem in cumulative update 19 for Microsoft Dynamics NAV 2013R2

Hi,

Cumulative Update 19 for Microsoft Dynamics NAV 2013 R2 has a problematic change that will affect your implementation of the cumulative update.


The problem is in table 114, Sales Cr. Memo Header, where the number of field 1300, Canceled, is changed to 1301. A typical partner development license does not allow field changes, so you will run into the problem when you try to import CU 19.

So Microsoft is going to announced hotfixes very soon to resolve this issue.

So here are the different way to work around the problem until next cumulative update released.



Rename the old field and merge the new field. Write code to copy values from the old field to the new field. See the following code as an example.
SalesCrMemoHeader.SETRANGE("Canceled 2",TRUE);
SalesCrMemoHeader.MODIFYALL(Canceled,TRUE);
SalesCrMemoHeader.MODIFYALL("Canceled 2",FALSE);
Where “Canceled 2” is the renamed field.
Note:
You will not be able to remove the old field.
In table 112, Sales Invoice Header, field 1301, Canceled, is a FlowField that uses field 1301 in table 114 in its CalcFormula. Because table 112 is not part of CU 19, the CU will fail if you try to compile table 112 because it points to non-existing field 1300 in table 114.

Tuesday, May 26, 2015

Cumulative update 26 for NAV2013

NAV 2013 - Cumulative update 26 has been released  

Hi,
Cumulative update 26 has been released for NAV2013(Build No. 40940) this month.

The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions: 
  • AU - Australia
  • AT - Austria
  • BE - Belgium
  • CH - Switzerland
  • DE - Germany
  • DK - Denmark
  • ES - Spain
  • FI - Finland
  • FR - France
  • IS - Iceland
  • IT - Italy
  • NA - North America
  • NL - Netherlands
  • NO - Norway
  • NZ - New Zealand
  • SE - Sweden
  • UK - United Kingdom

You can download this cumulative update from this Link

To download this update you must have "Customer Source" or "Partner Source" login ID

Thanks & Regards
Niraj Kumar


Friday, May 22, 2015

Create Multiple copies of Report in nav2009r2

Sometimes there is a need to print the multiple copies of Report in navision 2009R2. To do this there is very simple way. Now I am going to create a report to print a multiple copies of report in very simple way. I am going to create a simple ILE report to print multiple copies.
1) Create new report in given format
Untitled
2) Set first "Integer" dataitem properties "DataItemTableView" as SORTING(Number) and "NewPagePerRecord" as Yes.
3) Set second "Integer" dataitem properties "DataItemTableView" as SORTING(Number) WHERE(Number=CONST(1)).
4) Set third "ILE" dataitem properties "DataItemTableView" as SORTING(Entry No.).
5) Now write the code on CopyLoop - OnPreDataItem()
IF NoOfCopies >= 3 THEN
ERROR(Text003);
NoOfLoops := ABS(NoOfCopies) + 1;
IF NoOfLoops <= 0 THEN
NoOfLoops := 1;
CopyText := '';
SETRANGE(Number,1,NoOfLoops);

6) Now write the code on CopyLoop - OnAfterGetRecord()
IF Number >= 2 THEN BEGIN
CopyText := Text001
END;
IF Number >= 3 THEN BEGIN
CopyText := Text004;
END;
CurrReport.PAGENO := 1;
7) Leave the second "Integer" dataitem. There is no need to write any code on this dataitem.
8) Write the code on ILE dataitem as you want to filter the data or leave blank.
9)
keep your variables as i wrote
Name DataType Subtype Length
NoOfCopies Integer
NoOfLoops Integer
CopyText Text 30
Name ConstValue
Text001 Duplicate
Text002 Sales Invoice
Text003 More than two(2) copies are not permitted....
Text004 Triplicate
10) Section part is look like this
Untitled
Untitled
11) Now run the report

Untitled

Untitled