Microsoft Dynamics 365 Blog

FontBold property sets a value that indicates whether to display text in boldface. This property applies to form controls. In standard application this property is normally used to display accounts that are not posting accounts in boldface (form16 – Chart of Accounts). 

For a page field control, Style Property is used to format the text that displays in a page field. More details about this can be found in Microsoft Dynamics NAV Developer and IT Pro Documentation, designing pages.

When running Transofrmation Tool to transform forms to pages in NAV 2009 SP1, records displayed in boldface on a form are not displayed in boldface on the page, after the transformation.

To change this, following files should be modified:

Page.xsd (add property definition to page field control):

      ….

      <xs:element name=”ClosingDates” type=”NavBoolType” minOccurs=”0″ maxOccurs=”1″ />
      <xs:element name=”Numeric” type=”NavBoolType” minOccurs=”0″ maxOccurs=”1″ />
      <xs:element name=”DateFormula” type=”NavBoolType” minOccurs=”0″ maxOccurs=”1″ />
      <xs:element name=”Style” minOccurs=”0″ maxOccurs=”1″>  <!–  This is where the Style property is added. BEGIN changes  !–>
      <xs:simpleType>
          <xs:restriction base=”xs:string”>
              <xs:enumeration value=”None” />
              <xs:enumeration value=”Strong” />
              <xs:enumeration value=”Attention” />
              <xs:enumeration value=”Favorable” />
              <xs:enumeration value=”Unfavorable” />
          </xs:restriction>
      </xs:simpleType>
   </xs:element>
   <xs:element name=”StyleExpr” type=”xs:string” minOccurs=”0″ maxOccurs=”1″ />   <!–  This is where the StyleExpr property is added. END changes  !–>
</xs:all>
</xs:complexType>
….

Now that we have added Style and StyleExpr properties to the field control in page definition, we must modify CodeRules.txt file to transfer UPDATEFONTBOLD function to <FieldName>Emphasize variable defined for each field on page (that UPDATEFONTBOLD function was called for on a form).

In addition, Style property of the field shuld be set to Strong, and StyleExpr property to <FieldName>Emphasize. Transformation tool already creates a trigger called <FieldName>OnFormat for each field affected, that sets the value of <FieldName>Emphasize variable conditionally.

In short, replace the following code in file CodeRules.txt:

…..

 <find>
!currForm!.!var1!.UPDATEFONTBOLD :=
<declareVariable>
!var1!Emphasize
<declareVariableType>
Boolean INDATASET
<replace>
!declaredVariable! :=
<comment>

…..

with

<find>
!currForm!.!var1!.UPDATEFONTBOLD :=
<replace>
!currForm!.!var1!.UPDATEFONTBOLD :=
<moveValueToProperty>
Strong
<movePropertyToControlName>
!var1!
<moveToProperty>
Style

<find>
!currForm!.!var1!.UPDATEFONTBOLD :=
<declareVariable>
!var1!Emphasize
<declareVariableType>
Boolean INDATASET
<replace>
!declaredVariable! :=
<moveValueToProperty>
!declaredVariable!
<movePropertyToControlName>
!var1!
<moveToProperty>
StyleExpr

Run transformation tool on from 16, import and compile the page. When running page 16 (Chart of Accounts) the records should be displayed in boldface, the same way they are displayed on the form.

Jasminka Vukovic 

Microsoft Dynamics NO

Microsoft Customer Service and Support (CSS) EMEA

These postings are provided “AS IS” with no warranties and confer no rights. You assume all risk for your use.

 

 

TTool extended.zip

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!