Friday, September 11, 2009

Running Pages & Reports from Run

Running NAV 2009 Pages:

Click Start à Run, and run this:

DynamicsNAV:////runpage?page=90055


 

Running NAV 2009 Reports in RTC;

Click Start à Run, and run this:

Dynamicsnav:////runreport?report=111    


 

Debugging NAV 2009 Pages

Here is the nice post from clausl on how to debug the NAV 2009 pages. Please click the below link

Debugging in NAV 2009

Friday, September 4, 2009

IMPORTOBJECTS

IMPORTOBJECTS Function

Imports one or more objects from either a text file or an .xml file to the application.

IMPORTOBJECTS(FileName[, Format])
Parameters

FileName

Type: Text
The path and name of the file from which you import objects.
Format

Type: Integer
The type of the file from which you import objects. The valid values are 0 and 1. If you specify 0, then the file that you specify in the FileName parameter must be a text file. If you specify 1, then the file that you specify in the FileName parameter must be an .xml file. The default value is 0.
  Remarks

This function is not supported on the RoleTailored client.

This function achieves the same result as the Import item on the File menu in the Classic client.

After you import an object with this function, the object is not compiled. To run the object, you must first manually compile it.

  Example

This example imports an .xml file that contains page objects.

IMPORTOBJECTS('C:\MyExport.txt', 1);

EXPORTOBJECTS

EXPORTOBJECTS Function

Exports one or more objects to either a text file or an .xml file.

EXPORTOBJECTS(FileName, ObjectTableRecord[, Format])
Parameters

FileName

Type: Text
The path and name of the file to which you export objects.
ObjectTableRecord

Type: Record
Specifies a record in the Object table, which is table 2000000001. You can set filters on this record so that the exported objects are also filtered. For more information, see SETFILTER Function (RECORD).
Format

Type: Integer
The type of the file to which you export objects. The valid values are 0 and 1. If you specify 0, then the data is exported in text format. If you specify 1, then the data is exported in XML format. The default value is 0.
  Remarks

This function is not supported on Microsoft Dynamics NAV Server.

This function achieves the same result as the Export item on the File menu in the Classic client.

Exporting to an .xml file is only supported for form or page objects.

  Example

This example filters all reports in the range 50000 to 60000 and then exports the filtered set of reports to a text file. This example requires that you create the following variable.

VariableData typeSubtype
MyFilterRecordObject
MyFilter.SETFILTER(MyFilter.Type,'=Report');
MyFilter.SETFILTER(MyFilter.ID,'%1..%2',50000,60000);
EXPORTOBJECTS('C:\MyExport.txt', MyFilter, 0);

InstructionalTextML Property

Sets the Multilanguage value of the InstructionalText of the object. Use this property as a label.

This property is mainly useful for the ConfirmationDialog type pages. Text specified in this property will be shown when the form is opened.
InstructionalTextML ENU=The quantity on inventory is not sufficient to cover the net change in inventory. Do you still want to record the quantity?

Reference Page # 342


Page.RUNMODAL

Like in the Standard forms in the NAV 2009, pages also have the option to run it as Page.RUNMODAL.

CLEAR(SomePage)

SomePage.XXX; // any user-defined function

SomePage.SETTABLEVIEW(MyRecord);

SomePage.SETRECORD(MyRecord);

IF SomePage.RUNMODAL = Action::LookupOK THEN

SomePage.GETRECORD(MyRecord)...


If you want to use Page.RUNMODAL, we should be careful about the PageType property of the page.



PageType property should be Worksheet to show the fields in the page in proper order like below.





If the PageType property is not correct, then fields in the page will not be shown in the proper order.



The page shown above is for example purpose.

Thursday, September 3, 2009

First, Previous, Next and Last Buttons

In the NAV 2009 Classic client Card forms, it is possible to move between the records using First, Previous, Next and Last buttons.



In the NAV 2009 RoleTailoredClient, first List page will be opened. 

From the List page, Card page can be opened. But in the Card Page standard NAV has no buttons/options to move between the records.



The below steps will show how to add First, Previous, Next and Last buttons to the Card page

  • Open the Page 30 in design mode.
  • Go to the Action Designer using ViewàActions and add four Actions like below screenshot.

  • Change the properties of the Actions like shown in the below screenshot. 



Image property should be changed according to the functionality of the button.

Button        Image Property

First            PreviousSet

Previous    PreviousRecord

Next            NextRecord

Last            NextSet


  • Add the code for the new buttons like below screen.

  • Open the Item Card in the RoleTailoredClient.

First: First button will go to the first record in the table.
Previous: Previous button will go to the previous record.
Next: Next button will go to the next record.
Last: Last button will go to the last record in the table.