Transforming Forms to Pages

If you are using the Role Tailored Client and want to use the Forms in it, you have to transform them to Pages. In NAV 2009 you can transform Forms to Pages with the help of the form transformation tool.

So the first thing to do – is to install the form transformation tool. To install the form transformation tool, just copy the contents of the transformation tool folder to any location on the Microsoft Dynamics NAV 2009 server.

Before transforming the forms you should also take time to prepare the forms for the transformation. For example, it is not possible to transform Matrix forms also the controls MatrixBox and Shape are not supported. Therefore you might need to redesign your forms before transforming them to pages.

As an example – we will be transforming a simple customer form.

transforming-form-50500-customer-classic-client

Now it is time to define the transformation input. Transformation input files, are XML files that define mapping rules. The transformation input files can be modify either by the use of the Transformation Input File (TIF) Editor or by modifying the XML files directly.

Let’s do it by using the TIF Editor. I will not go into details on how to install and setup the TIF Editor.
If the TIF Editor add the Form, if it is not already there, then setup FormType, PageType and CardFormID – Validate the input (Functions -> Validate)

transforming-create-transformation-input

Then finally end by exporting the xml (Functions -> Create Transformation Input -> Pages or Functions -> Create All Transformation Input).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<TransformPages xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
	<Page ID="50500" Name="Customer - Classic Client">
		<Transformation FormType="Card"/>
		<Properties>
			<PageType>Card</PageType>
			<CardFormID>50500</CardFormID>
		</Properties>
	</Page>
</TransformPages>

Next export the form to an xml file. Remember to call the file Forms.xml and store the file in the same directory as the Form Transformation Tool.

This is not the complete XML - just a part of it ;-)

<?xml version="1.0"?>
<Objects xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
  <Form xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects" ID="50500" Name="Customer - Classic Client" Date="2009-06-05" Time="19:59:43.88Z" Modified="Yes" VersionList="">
    <Properties>
      <Width>9790</Width>
      <Height>6160</Height>
      <SourceTable>Table18</SourceTable>
    </Properties>
    <Triggers/>
    <Controls>
      <Control>
        <Properties>
          <ID>1</ID>
          <Controltype>Frame</Controltype>
          <XPos>220</XPos>
          <YPos>220</YPos>
          <Width>9350</Width>
          <Height>4950</Height>
          <HorzGlue>Both</HorzGlue>
          <VertGlue>Both</VertGlue>
          <ShowCaption>No</ShowCaption>
        </Properties>
      </Control>
      <Control>
        <Properties>
          <ID>14</ID>
          <Controltype>TextBox</Controltype>
          <XPos>3850</XPos>
          <YPos>3740</YPos>
          <Width>2750</Width>
          <Height>440</Height>
          <ParentControl>1</ParentControl>
          <InFrame>Yes</InFrame>
          <SourceExpr>"Post Code"</SourceExpr>
        </Properties>
      </Control>
    </Controls>
    <Code>
      <![CDATA[
            BEGIN
            END.
      ]]>
    </Code>
  </Form>
</Objects>

Note that the XML now contains a lot of information about Controls and Positions.

Now run the Form Transformation Tool. This is done by going into your Transformation Tool directory and double clicking on “Microsoft.Dynamics.Nav.Tools.FormTransformation.exe”.

Afterwards you can check the log files for errors. If errors occur, then fix them and run the tool again.

———— Transformation started at 05-06-2009 22:26:31 ————
Forms file: .\Forms.xml
Pages file: .\Pages.xml
InsertElements file: .\TransformPages.xml
IgnoreForms file: .\IgnorePages.xml
DeleteElements file: .\DeleteElements.xml
MoveElements file: .\MoveElements.xml
RenumberPages file: .\MovePages.xml
CodeRules file: .\coderules.txt
———————————————————————–

The form has now been transformed to a page and is located in the file Pages.xml:

This is not the complete XML - just a part of it.

<?xml version="1.0"?>
<Objects xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
  <Page ID="50500" Name="Customer - Classic Client" Date="2009-06-05" Time="19:59:43.88Z" Modified="Yes" VersionList="">
    <Properties xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
      <PageType>Card</PageType>
    </Properties>
    <SourceObject>
      <SourceTable>Table18</SourceTable>
    </SourceObject>
    <Triggers xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects" />
    <Actions>
    </Actions>
    <Controls>
      <ContentArea>
        <Properties>
          <ID>1900000001</ID>
        </Properties>
        <Group>
          <Properties>
            <ID>1</ID>
          </Properties>
          <Field>
            <Properties xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
              <ID>2</ID>
              <SourceExpr>"No."</SourceExpr>
            </Properties>
          </Field>
          <Field>
            <Properties xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
              <ID>4</ID>
              <SourceExpr>Name</SourceExpr>
            </Properties>
          </Field>
        </Group>
      </ContentArea>
    </Controls>
    <Code xmlns="urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects">
       <![CDATA[
           BEGIN
           END.
       ]]>
    </Code>
  </Page>
</Objects>

The Page is now ready to import into the database. This is done by importing the Pages.xml file located in the transformation tool directory. When the Page is imported, remember to compile it afterwards.

Now you will be able to use it from the Role Tailored Client. You can test it by running it directly:

DynamicsNAV:////runpage?Page=<PageID>

and will look something like this:


transforming-page-example

4 Comments

  1. I love your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz answer back as I’m looking to design my own blog and would like to find out where u got this from. thanks a lot

  2. Hi Ardelia

    As you can see below in my footer – I’m using a theme by N.Design Studios as foundation. I have been customizing it a bit my self too… so you will not be able to located the exact same match.

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.