Problems in transformation forms to pages using TransformationTools
After Microsoft Dynamics NAV 2009 SP1 release more and more developers start using it and trying to adopt existing solutions for new 3tier environment.
Most workload comes from trying to adopt current forms to new object - pages.
Particularly transformation could be done by using TransformationTools (https://msdn.microsoft.com/en-us/library/dd338789.aspx), however it is not "best ever" and partners reporting problems and require to fix it...
But it isn't so easy...
This tool is delivered to us from dev team and it helps us to make transformation faster, but it is supplementary tool - we can use NAV without this tool and we can "convert " our solutions without it - do it manually.
So "big thanks" to dev team for this tool, however we can't expect that dev team will fix all problems in tool with the same priority as base products (Microsoft Dynamics NAV).
And we can't expect fixes for problems related to incorrect transformed statements - after transformation pages can't be compiled...
Problem is in tool simplicity: it searches for text and convert it to another text. Converting rules are described in file CodeRules.txt (https://msdn.microsoft.com/en-us/library/dd338843.aspx).
But simplicity is as strength as weakness of this tool - only text described in CodeRules.txt file will be converted, if there are any differences in text - transformation will be incorrect.
For example:
In form code we have statement:
CurrForm.Number.UPDATEFONTBOLD(Number);
Then after transformation on page will be created new variable NumberEmphasize
And statement will be converted to:
NumberEmphasize := Number;
It is because UPDATEFONTBOLD is not used in pages and must be removed.
So far so good.
Tranformation will be done correct for statements:
CurrForm.Number.UPDATEFONTBOLD(Number1=Number);
CurrForm.Number.UPDATEFONTBOLD(Number1>Number);
and etc. because transformation rules are described in CodeRules.txt
But transformation tool is looking for direct text fit to rules and will not transform text which is not described in Coderules.txt.
If code becomes little more complicated (not described the same syntax as CodeRules) - transformation tool capitulates.
For example next code will not be transformed:
CurrForm.Number.UPDATEFONTBOLD(Number1<Number);
CurrForm.Number.UPDATEFONTBOLD(Number1=xRec.Number);
CurrForm.Number.UPDATEFONTBOLD(xRec.Number1=Number);
CurrForm.Number.UPDATEFONTBOLD(Number1=Number2=Number3);
CurrForm.Number.UPDATEFONTBOLD(Number1=(Number+100));
...
Yes... We can make rules for these statements too (dev team delivered rules file), but we will never describe everything what could be written by happy-creative developpers around the world...
Maybe some rules could be never used? Who knows..?
I can collect all requirements for CodeRules.txt and periodically release new one (fixed). Do you want to order me do it, let me know in comment to current post :) ...
These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.
Gedas Busniauskas
Microsoft Lithuania
Microsoft Customer Service and Support (CSS) EMEA
Comments
- Anonymous
December 09, 2014
We are about to convert to RTC do you have an update coderules.txt file that I can use