I have collected few tips maybe could be used in NAV 2009 developing.
Don't claim me too much if this looks to easy... 🙂
- Files managing on RTC pc.
In C/AL we have statements for working with files like: EXISTS(<File_Name>); RENAME(<Old_File_Name>,<New_File_Name>); ERASE(<File_Name>); COPY(<From_File_Name>,<To_File_Name> ) . But this is working only on CC, as on RTC these statements are executed on Service Tier. What to do if we want to managing files on RTC PC?
I propose to use automation: 'Windows Script Host Object Model'.FileSystemObject. If we create it using "Client side" parameter, then automation will be loaded on RTC and we can use all functions from it.
For example functions:
Function in NAV C/AL Function in automation EXISTS(<File_Name>); <automationName>.FileExists(<File_Name>); RENAME(<Old_File_Name>,<New_File_Name>); <automationName>.MoveFile(<Old_File_Name>,<New_File_Name>); ERASE(<File_Name>); <automationName>.DeleteFile(File_Name>[, BOOL Force]); COPY(<From_File_Name>,<To_File_Name> ) <automationName>.CopyFile(<From_File_Name>,<To_File_Name>);
- Different view of boolean fields in RTC.
Usually boolean fields are showed as checkmarks in RTC, but we can make it in different view - show "Yes/No". This could be done by just adding comments to filed trigger "OnDrillDown".
Here is example what we see in RTC: 1st boolean has comments in trigger as 2nd is typical view.
- Usage virtual table 2000000022 "File" in RTC.
If you are using this virtual table somewhere in CC and now want to transfer functionality to RTC, you need to know few points:
- Virtual table will show files/olders on service tier (not on RTC) and this is different from CC where you saw info from user pc.
- If you are using table "File" in RTC, then don't use field "Data". In CC it shows "*" if there are data in file, however RTC starts reading all data from file and loads memory/processor.