I was recently afforded the opportunity to attend a NAV 2009 R2 Technical Deepdive session at Microsoft TVP. Whilst I had been exposed to many of the new features via many blogs from various people, it... (Continue reading)

So I'm sure everyone has already read the blogs previously posted by freddyk and waldo on the subject of consuming web services exposed by NAV, but as promised here is the continuation of my journey.... (Continue reading)

So it’s been more than a year since I posted last - Time does certainly fly when you are having fun. Thankfully my day job has been keeping me very busy, and this is never a bad thing. Interestingly though... (Continue reading)

Up to this point we have been preparing the structures needed to support our application. We have created the traditional simple tables and forms, as well as gone through the process of generating some... (Continue reading)

So last time we looked at a very simple transformation process for the few forms that we have created for the little Fuel Application ( look here ). This time we are going to do exactly the same thing... (Continue reading)

NAV 2009 Web Services (Part 2b – Forms & Pages + TIF Editor)

So last time we looked at a very simple transformation process for the few forms that we have created for the little Fuel Application (look here). This time we are going to do exactly the same thing – create some pages – but we are going to see if the Transformation Input File (TIF) Editor can provide us any assistance.

Effectively the TIF editor is collection of NAV objects which are simply imported into the database and used to assist in the manipulation of the raw XML transformation files (ie. the TransformPages.xml, IgnorePages.xml, MovePages.xml, DeleteElements.xml and MoveElements.xml). As I have mentioned before, if you are comfortable with XML and its manipulation then you could simply edit these files directly, or perhaps even with another tool. We'll have a look and see what the tool from Microsoft gives us here.

The first step is to get hold of the relevant objects. As per the help files - you must copy the form transformation tool files before you can transform forms. The files that you must copy are located in the TransformationTool folder and the TransformationTool\TIF Editor folder on the installation DVD. It is the TIF.fob object file in the latter directory which we must then import into our NAV database. There you have it – all "installed"!

So what to do next...

Our starting point is one of the new forms that we have just imported as part of the TIF.fob file – Form 177000 Transformation Forms. This seems to be the central form as the other functions hang off of here. In the case that we wanted to transform a standard NAV form we would then set about the process of importing all of the xml files and then manipulating the records that we would have in this form. We of course have a few new forms which the standard application has never heard of. Our process is therefore first to tell the system about our forms. We can do this by manually entering the data, but more likely is that we will wish to use a function on the Setup button to do the job – Get Forms. This will allow us to specify a range of forms to include.

In our case, I specify the new form nos – 50000..50002 and the system inserts the 3 records for me. Well at least it inserts the Name and number! The rest I must now complete manually to tell the system how I would like to transform the various pages.

Firstly I try to lookup the FormType however I only see a blank table. To populate this table I must import a mapping file which will allow me to select the form type, and have the system automatically insert the page type. This can be done again from the Setup button – Import FT-PT mapping. Navigate to the FormToPagetypeMapping.txt file in the TIF editor folder and confirm to import.

Next assign the types to the forms and specify the cardform id against the vehicle list form:

ID

Name

Changed

FormType

PageType

CardFormID

CardFormID for

Ignore

DestinationID

DestinationName

FormReplacedBy

Comment

50000

Fuel Entries

No

List

List

0

No

Inserted 10/06/09 19:28

50001

Vehicle Card

No

Card

Card

50002

No

Inserted 10/06/09 19:28

50002

Vehicle List

No

List

List

50001

0

No

Inserted 10/06/09 19:28

This should be all that is required to generate the required xml transformation files. Export these files using the Functions button – Create All Transformation Input. Note: you will need to make sure you have specified the relevant folder in the setup form in order that the files be created in the correct place.

Whilst the 5 xml files have been created, only the TransformPages.xml file contains any data at this point.

This is because we have not added or changed any of the form properties etc in the TIF Editor.

At this point we should now be in a position to take the Forms.xml file from my last blog (ie. the xml export of the 3 forms from NAV) and run it through the transformation tool (again as we did before).

Interesting to note at this point that you may get an error similar to the following in your transformation log:

Error: Form -2: The element 'IgnorePages' in namespace 'urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects' has incomplete content. List of possible elements expected: 'Page' in namespace 'urn:schemas-microsoft-com:dynamics:NAV:ApplicationObjects'. Error: Some input file can't be validated by schema. Please, correct it and rerun tool again

I'm not yet aware of a fix for this so I edited the XSD files as the post mentions. Note however that I also needed to amend the MovePageElements.xsd file.

So finally we can import our new Pages.xml file and check our results.

So whilst we have basically followed the same process, we get slightly different results. The benefit of using the TIF editor to arrive at these new pages is that we can very easily add additional components and change attributes without directly manipulating the resultant pages. This means that the process is then repeatable.

So whichever method we choose, we now have the required pages for our application. We could go about adding these to an existing page or role center or creating a new one, however as we are more concerned with consuming these pages via an external application we will leave that to a more capable person.