Jnl.Line Dimension - TableRelation too long

Hi! I am currently developing a new application area. I created among other things, a journal template, batch and line tables and tried to use Journal Line Dimension table for keeping dimension info on my journal lines. Here I ran into a difficulty. It seems that Navision allows maximum of 999 characters in Table Relation property of a field. With addition of relation to my tables, the string in TableRelation property of Journal Batch Name field exceeds 999 characters. I can add the relations in the Table Relation form, but when I click OK I get the message saying: “The length of the source exceeds the size of the destination buffer” The only alternative I can see right now is to remove TableRelation property from the field and add code to validation of Table ID that would simulate table relation. I am loathe to do that if there are any other options. Any input would be appreciated. Thanks, Jurica

Given the 999 characters, I have to assume you have a fairly complex IF … ELSE IF … ELSE IF … relation. Would it be possible to rename the field, options, or the target tables to something less verbose? i.e. “Journal Line Dimension” → JnlLineDim “My Dimension Option Field” → Type Alternatively, can the data be restructured to avoid the complex relation? Compare the relation on “No.” in the system wide Comments Line table (97) to the fact that no special relation is required for the more specific “Purchase Comment Line” and “Sales Comment Line” tables. (I’m working in 2.60)

quote:


Originally posted by watm
Given the 999 characters, I have to assume you have a fairly complex IF … ELSE IF … ELSE IF … relation. Would it be possible to rename the field, options, or the target tables to something less verbose? i.e. “Journal Line Dimension” → JnlLineDim “My Dimension Option Field” → Type Alternatively, can the data be restructured to avoid the complex relation? Compare the relation on “No.” in the system wide Comments Line table (97) to the fact that no special relation is required for the more specific “Purchase Comment Line” and “Sales Comment Line” tables. (I’m working in 2.60)


Unfortunately, the existing relation in base 3.60 version is somewhere around 970-980 characters. Adding one more relation is what brings the string over 999 chars. Changing existing relations isn’t an option, as I would have to shorten field and table names of objects totaly unrelated to my add-on, which would complicate upgrades a lot. I decided to leave the relation out and use OnRename/OnDelete triggers in my tables to simulate relation to Jnl. Line Dimension table. Thanks for help, Jurica

Hi, you can shorten few fiel and/or table names, then add relations, save object, and then rerename renamed fields/tables - everything will be ok.

quote:


Originally posted by Viktoras
Hi, you can shorten few fiel and/or table names, then add relations, save object, and then rerename renamed fields/tables - everything will be ok.


Thank you, it works and I would never have thought of it. The only problem: I can’t design the Journal Line Dimension table any more after I put the names back to what they were. When I try to open the table in design view I get the “source too long for dest. buffer” message. I can export the table to text file and import it back. The table still works properly, just can’t be designed. So I guess I would have to put it under “excellent solution that my boss would kill me if I use it”[:(] Thanks anyway, Jurica