Showing posts with label Pages. Show all posts
Showing posts with label Pages. Show all posts

Friday, July 23, 2010

IndentationColumnName and IndentationControls properties

IndentationColumnName and IndentationControls are the page properties in the NAV 2009. These properties are used to indent the controls or columns.

Transformation Tool will automatically convert the following type of code in the form and adjust the above two properties in the page to show the data as indented.

For Example: Form 18, CurrForm.Name.UPDATEINDENT := Indentation * 220;

Now the major problem in the pages is, you cannot use these properties for the fields that are editable and has a table relation.

For example, you cannot indent Item No. or Location Code in the Item Journal page because these fields are editable and has a relation with another table. If you try to indent these fields, while entering the data into these fields, field value is automatically updated with the first value.

If you press “1” in the Item No. field, it will be automatically filled with the first value starting with 1 like “1000”.

Wednesday, June 2, 2010

Shortcuts in NAV 2009 (Special for List Page)

In NAV 2009 SP1, we all know that Ctrl+Shift+V is to open the page in View Mode, Ctrl+Shift+E is to open the page in Edit Mode.

Along with the above two shortcuts, we also have Ctrl+Shift+L to open the list page in View Mode, Ctrl+Shift+K is to open the list page in Edit Mode.

image But the second shortcuts (Ctrl+Shift+L, Ctrl+Shift+K) won’t work for all list pages. My learning today is, second shortcuts are only applied to the list pages which does not have a card page attached to it.

For Example: Payment Terms page which has no card page linked will show Ctrl+Shift+L and Ctrl+Shift+K.

imageFor Example:  Item List page which has card page (30) linked will show Ctrl+Shift+V and Ctrl+Shift+E.

image

Thursday, May 20, 2010

HideValue Property in NAV 2009 Pages

May be many of you are aware of the new field property “HideValue” for the Pages.

imageIf you set this property to TRUE, value in this field is not displayed in the Page. In the following scenario, I will explain how to automatically set this property to TRUE using the Transformation Tool, instead of changing the property value manually.

Let’s go to the customer card and go to OnFormat Trigger of the Name field. Adding one line of code will do the same functionality as HideValue property.

image Transform the form to page using the Transformation Tool and check the output in Role Tailored Client.

Form Output:image

Page Output:image

Tuesday, May 11, 2010

Web Reference in Visual Studio

As specified in one of the help scenario, I created a codeunit with two functions in it and published that to the web services along with the customer card and named both as ‘PageWithCapitalization’.

image

imageWhen I try to create a web reference in the Visual Studio, as the two web services I published has same Service Name, the Page web reference also has the methods of the codeunit.

image

Sunday, April 18, 2010

DataCaptionFields and DataCaptionExpr property

This is a simple and known work around to set the form/page caption. This is particularly useful if you want to set an option field as form caption because changing the DataCaptionFields property won't work in the form and page.

In the following example scenario, I will include "Document Type" into the caption of the sales order form. This can be achieved by simply creating a function and changing the DataCaptionExpr property.

  • Create a function.

image

  • Add the following code in the function.

image

  • Change the DataCaptionExpr property as below:

image

  • Run the Sales Order and see the ouput.image

Friday, January 29, 2010

Calculated field on a page is only recalculated when the OnValidation trigger is run

A page will only update a field if it detects that there is some code on the OnValidate trigger. This is done for performance reasons to avoid unnecessary updates.

Please click the link to read the complete story from the Microsoft Dynamics NAV Team Blog.

Wednesday, December 23, 2009

Transformation Tool Issue

There may be possibility in some forms to show the records in bold & colors based on the conditions.

CurrForm."No.".UPDATEFONTBOLD(Condition);

CurrForm."No.".UPDATEFORECOLOR(Condition);

While converting this form to page using Transformation Tool, we will face compilation errors in page because same code is moved into the pages.

After the R&D, I found CodeRules.txt in the Transformation Tool does not have proper rules to transform the above kind of code in to pages.

For Example:

For CurrForm.”No.”.ENABLED(Condition), it is working properly because of the following marked code rules.

  • <find>
  • !currForm!.!var1!.ENABLED :=
  • <declareVariable>
  • !var1!Enable
  • <declareVariableType>
  • Boolean INDATASET
  • <replace>
  • !declaredVariable! :=
  • <moveValueToProperty>
  • !declaredVariable!
  • <movePropertyToControlName>
  • !var1!
  • <moveToProperty>
  • Enabled
  • <comment>

But for Currform.”No.”.UPDATEFONTBOLD(Condition), it is not working because there are not code rules for <moveValueToProperty> <movePropertyToControlName> <moveToProperty>

  • <find>
  • IF !var1! <> !var1!::!var2! THEN
  •   !currForm!.!var3!.UPDATEFONTBOLD := TRUE;
  • <replace>
  • !currForm!.!var3!.UPDATEFONTBOLD := !var1! <> !var1!::!var2!;
  • <find>
  • !currForm!.!var1!.UPDATEFONTBOLD :=
  • <declareVariable>
  • !var1!Emphasize
  • <declareVariableType>
  • Boolean INDATASET
  • <replace>
  • !declaredVariable! :=
  • <comment>

Solution: Either we should change the code rules or modify the page manually.

Saturday, October 24, 2009

How Run button in Object Designer opens the page in the RTC

In the NAV 2009 SP1, it is possible to run the Page from the Object Designer.

image In the Object Designer, Run button will open the related page in Role Tailored Client. I think this is achieved using the HYPERLINK function in Navision.

HYPERLINK function passes a URL as an argument to an Internet browser.

By adding the following code in OnPush Tirgger of any button will open the related page in Role Tailored Client.

HYPERLINK('DynamicsNAV:////runpage?page=' + FORMAT(ID));

Here ID valud should be Page ID.

The above code can also be applied to open the reports in Role Tailored Client.

HYPERLINK('DynamicsNAV:////runreport?report=' + FORMAT(ID));

The above line of code can be added to any form/page to open the pages/reports dynamically.

Friday, October 23, 2009

Transformation Tool: Subfrom Menu Items to Pages

Using Transformation Tool it is possible to transform forms to pages in NAV 2009.
Forms like Sales Order, Purchase Order has Line Menu Button in the Main from and Transformation Tool automatically transforms the Line Menu button to the Sub page (ListPart). If the Menu Button has any Menu Items, Transformation Tool will also move the Menu Items to the Sub page.

Logic behind this is,Transformation Tool moves the Menu Item to Sub page if it finds the code like “CurrForm.subform.FORM.FunctionName” in the Onpush of the menu item.
Sales Order—>Line—>Reservation Entries, OnPush trigger has the following code.
CurrForm.SalesLines.FORM.ShowReservationEntries;
image

For example if you want a confirmation message before opening the reservation entries, you can write the code in the function or you can write like below:
IF CONFIRM(Text123,TRUE) THEN
  CurrForm.SalesLines.FORM.ShowReservationEntries;

If the code is like above, Transformation Tool will not move this Reservation Entries menu item to sub page. It will create a new Line menu button in the main page and add the Reservation Entries menu item to that.
image
TIP: If your requirement needs to write code before calling the function in the subform, maintain the code in single line like the following:
IF CONFIRM(Text123,TRUE) THEN CurrForm.SalesLines.FORM.ShowReservationEntries;

Monday, October 12, 2009

ProviderID property to System Parts

Last week after posting the learning on ProviderID property, I am going through the mibuso and found any interesting post related to the ProviderID linking to the System Parts.

I also tried to achieve this, but not able to find any solutions except create a new list page and adding system part to that.

The solution kine has given is working.

-Create a list page based on Sales Line.

-Add only two line. One Container and another Part.

-Change the Parttype to System and SystemPartID to Recordlinks for the part.

-Add the new list page to sale order form as Factbox

-Set the ProviderID and SubFormlink.

This solution is working as temporary.

Friday, October 9, 2009

ProviderID property in NAV 2009

ProviderID property is specifically for the RoleTailored client and not supported in the Classic Client.

This property enables you to create a link from a Repeater or any other type of control to a Factbox. It could also be used to link two FactBoxes. For example, the Sales Order page (42), uses this property to update the Sales Line FactBox by creating a ProviderID link to the SalesLines FastTab.

image

For Example:

If you open the Page 42 in design mode, <Control1906127307> “Sales Line FactBox” control ProviderID value is 58 which is the ID of the SalesLines control in the same page.

image 

That is the reason if you open the Sales Order page in Role Tailored Client, Sales Line Factbox details are updated based on the Sales line you selected.

image

Thursday, October 1, 2009

Save View As in NAV 2009

In the Classic Client of NAV, it is possible to send the forms or reports in the Navigation Pane to the shortcuts using Ctrl+Alt+S or right click on the Item and selecting the “Send to Shortcuts” option.

imageSimilar kind of option also available in the NAV 2009 RT Client. The following exercise will show the procedure to add any form to the Navigation Pane.

Open the Role Tailored Client and select the Sales Orders

imageApply any filter to the Sales Order list page like the following:

image Select the Save View As option like the following:

image 

In the Save View As form you can change the Name accordingly and can change the Activity Group also.

image

System will also for restart confirmation to effect the changes and select Yes and check Home in the Navigation Pane.

image

New view is added to the Home and If you open the page you can still see the filters applied previously. Cool….

It is also possible to remove the views added to the Navigation Pane.

Select the Customize Navigation Page option.

image

Select the page you want to remove and select Remove option (or) Select Restore Defaults to remove all the changes and restore to the default view.

image

Wednesday, September 16, 2009

How to Zoom in NAV 2009 Pages?

In the NAV Classic client forms using Tools-->Zoom (Ctrl+F8) we can see the all the fields and its values.

In the NAV RT Client pages also it is possible to zoom the page using About the Page (Ctrl+Alt+F1) in the top right side of the page.



NOTE: Zooming the Listpart (i.e. subform) is only possible by keeping the cursor in the subform and pressing Ctrl+Alt+F1 Keys. Clicking the About the Page button in the top right side of the page only works for the main forms.



NOTE: In the classic client zoom option display the fields in the same orders  as the fields in the table. In the RT Client zoom option displays first primary key field values and the remaining fields in the alphabetical order and Field ID also displayed...Nice....






 


 


 

How to place the Actions in the pages to new category (NAV 2009)

Instead of placing the actions in the standard categories like New, Process and Report, you can also place your action to your own categories.
The following steps will show the process with an example:

In the object designer, design the page 30 Item Card.

Move to the last blank line in the page.

Go to the Actions using ViewàActions.

Go to the properties of the Action you want to move to the new Category.

Change the following properties:
    • Promoted to Yes
    • PromotedCategory to Category4. Category 4 to 10 are available in the NAV 2009 SP1, other than the standard categories like New, Report and Report.
    • PromotedIsBig to Yes
Go to the Page properties and change the PromotedActionCategoriesML property value like below:
          ENU=New,Process,Report,New Category
First three values should be same like New, Process, Report and from there you can give your own name. If you change these values standard page Categories will be changed.

Run the page in RTC and see the result. You will find a new Category with "New Category" which has your action.

Friday, September 4, 2009

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


Thursday, September 3, 2009

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.