Text File Format Problem

seemaseema Member Posts: 17
Hi Everybody,

I need to import the text file (exported by Navision default functionality) of a Table Object through my own code. But, there are some properties of Table which comes before Triggers and some comes after triggers. The same behaviour is being followed in case of fields also. Can somebody help me what are the properties which come before Triggers and which properties come after triggers.

Any help regarding the text format of object will be highly appreciated.

Thanks in advance

Comments

  • kinekine Member Posts: 12,562
    I don't know why you need it... but it is simple:

    It is structured: On top you have global settings and properties, than field definitions which have nested local triggers with local variables and properties... then keys and than global triggers and functions.
    <TABLE OBJECT> :=
    <OBJ HEADER>
    <OBJ PROP>   
    <GLOBAL PROP>//properties and global triggers
    <FIELDS>
        <FIELDS PROP>
        <FIELDS CODE>
    <KEYS>
    <GLOBAL CODE> //FUNCTIONS, global variables
    

    Each code section have (or can have) section with Functions and local variables, Global code have section with global variables etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • seemaseema Member Posts: 17
    Hi kine,

    Thanks for your such a fast response, But I think you didn't get my question. As you are saying that format is like following
    <FIELDS>
    <FIELDS PROP>
    <FIELDS CODE>
    But if you will check with a number of properties being modified, you will find that some properties are before triggers and some after triggers. The behavior is same in case of fields as well as in case of table.

    If you have any idea, pls let me know.

    Thanks in advance
  • fbfb Member Posts: 246
    Why not design your parser with the following rules in mind:
    • Triggers are properties.
    • Properties have the basic form <PropertyName> = <Property Value>.
    • The list of PropertyNames is well known -- changes slowly as the C/SIDE version changes.
    • Table PropertyNames include OnInsert, OnModify, OnRename and OnDelete.
    • Field PropertyNames include OnValidate and OnLookup.
    • Properties may appear in any order.
  • kinekine Member Posts: 12,562
    fb wrote:
    Why not design your parser with the following rules in mind:
    • Triggers are properties.
    • Properties have the basic form <PropertyName> = <Property Value>.
    • The list of PropertyNames is well known -- changes slowly as the C/SIDE version changes.
    • Table PropertyNames include OnInsert, OnModify, OnRename and OnDelete.
    • Field PropertyNames include OnValidate and OnLookup.
    • Properties may appear in any order.

    I agree fb. Property can be in any order...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • seemaseema Member Posts: 17
    Thanks Kine & fb,

    You both are absolutely right, I am also agree with you but I have to recreate the text file with the help of my code only, then how will I handle the properties and triggers.

    Pls help.
    Thanks
  • kinekine Member Posts: 12,562
    If you need to export in same order, you must save somewhere the order. If you don't need it in same order, it is on you how you will export it. It depend on your internal structure of saved data...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • seemaseema Member Posts: 17
    I am writing code to import the text file into Navision Tables and then We may change some properties or the triggers of any field or of table. And after that I have to write code to export the text file. Then this text file will be imported to Navision. Then this object should work properly. (My work is to create some functionality of Developer Toolkit.)

    If the order of some properties will be changed, then It may or mayn't work properly.
    I hope you are getting my concern.
    Thanks
Sign In or Register to comment.