After you transform a form to a page, you may encounter problems with text boxes that were used as labels on the form, because they may not be transformed correctly to labels on the page. This issue occurs when a text box on a form does not comply with the text box control mapping rules in the form transformation tool. For more information about built-in text box control rules, see the Text Box Control section of Control Mapping Rules.
Text boxes are transformed in the following cases:
-
Text box is a regular control. It is transformed to a field.
-
Text box is used for instructional text and has the Width property >= 6100. It is transformed to a field. In this case, the value of the SourceExpr property is transformed to the CaptionClass property of the transformed field. The result of the calculated CaptionClass property is displayed as the label.
-
Text box has the Focusable property set to No, has a value for the SourceExpr property, and is adjacent to another control. To be adjacent, the Xpos of the control must be between 55 and 165 pixels of the end of the text box (Xpos + Width). The Ypos of the control and the Ypos of the text box must be within 25 pixels of each other. In this case, the value of the SourceExpr property is transformed to the CaptionClass property of the field on the page. The result of the calculated CaptionClass property is displayed as the label.
Note Using the CaptionClass property of a text box as the label instead of using a label causes the client to submit more requests to the server to calculate the CaptionClass value and therefore can affect performance.
The following procedure describes how to verify and redesign text boxes that are used as labels on the form so that they are transformed correctly.
To complete this procedure, you will need:
-
Microsoft Dynamics NAV 2009 with a developer license.
-
All Microsoft Dynamics NAV 2009 requirements. For more information, see Microsoft Dynamics NAV 2009 SP1 Requirements.
Text Box Used as a Label
The following illustration shows a form that uses a text box as a label. In this example, the text box does not meet the Xpos requirements to be adjacent to another control.
The following illustration shows the resulting page if you transform this form.
The Overdue Amounts (LCY) label is not transformed correctly. To resolve this issue, move the text box or the adjacent control so that Xpos of the adjacent control is between 55 and 165 pixels of the end of the text box used as a label (Xpos + Width) and the Ypos of the control is within 25 pixels of the Ypos of the text box used as a label.
To verify that the text box label is adjacent to the control
-
In the Classic client, on the Tools menu, click Object Designer.
-
In Object Designer, select Form, select the form that you want to transform, and then click Design.
-
If the following conditions are true for the text box, then the value of the SourceExpr property are transformed to the value of the CaptionClass property of the adjacent control. The value of the CaptionClass property is then used as a label on the page.
-
The text box does not have a parent control other than the container control.
-
The Focusable property is set to No.
-
The SourceExpr property has a value.
-
The text box is positioned adjacent to another control, such as an option button.
Note The text box is considered adjacent to anther control if the Xpos of the adjacent control is between 55 and 165 pixels of the end of the text box used as a label (Xpos + Width) and the Ypos of the control is within 25 pixels of the Ypos of the text box used as a label.
The following illustration shows the transformed page with the text box label transformed correctly.
-
-
To save and compile your form, close the form in Form Designer. In the Save Changes window, confirm that the Compile check box is selected, and then click Yes.