Adding a new field dynamically to a table

navvy
Member Posts: 79
Hi,
I have to add a new field to several tables on different NAV installations. Is there a way to add these fields "dynamically" ?
Is it possible to put CAL code "dynamically" behind a table (e.g. on OnInsert()) ?
Thanks in advance,
navvy
I have to add a new field to several tables on different NAV installations. Is there a way to add these fields "dynamically" ?
Is it possible to put CAL code "dynamically" behind a table (e.g. on OnInsert()) ?
Thanks in advance,
navvy
navvy
Freelance Developer
Freelance Developer
0
Comments
-
No, C/SIDE does not allow that.
There might be work-arounds on a NAV SQL Server setup by writing SLQ code (etc.), but I guess that's not what you are looking for.0 -
You can do an insert in the Field table as long you have the appropiate license and use the correct field numbers.
Field.INIT; Field.TableNo := DATABASE::Currency; Field."No." := 11002002; Field.FieldName := 'My Field'; Field.Class := Field.Class::Normal; Field.Type := Field.Type::Boolean; Field.Enabled := TRUE; Field.INSERT;
0 -
Maybe I thinking wrong (and reading the original post wrong), but that's not adding a field to a tbale, but populating existing fields with values.
Right?0 -
lvanvugt wrote:Maybe I thinking wrong (and reading the original post wrong), but that's not adding a field to a tbale, but populating existing fields with values.
Right?
Did you try it, my sample code? This will create an actual NEW field in Table 4...0 -
YOU ARE RIGHT. Learned something again. Thanx!0
-
Duikmeester wrote:You can do an insert in the Field table as long you have the appropiate license and use the correct field numbers.
I disagree with this approach completely. Yes it can be done, but why would you?
You still have to get that code on to the customer database somehow. So you're importing an object regardless. How could writing code to add a field possibly save time over just simply adding the field by hand?
I learned a long time ago that NAV wants you to do things in a certain way. That doesn't mean don't find ways to improve processes, that's what NAV is about, but when it comes to the basics, like adding a field, stick to the usual method.0 -
Thank you for all your answers !
Because I also have to put CAL code behind the tables (e.g. on OnInsert()), I think I will add the new fields by hand.
navvynavvy
Freelance Developer0 -
matttrax wrote:Duikmeester wrote:You can do an insert in the Field table as long you have the appropiate license and use the correct field numbers.
I disagree with this approach completely. Yes it can be done, but why would you?
You still have to get that code on to the customer database somehow. So you're importing an object regardless. How could writing code to add a field possibly save time over just simply adding the field by hand?
I learned a long time ago that NAV wants you to do things in a certain way. That doesn't mean don't find ways to improve processes, that's what NAV is about, but when it comes to the basics, like adding a field, stick to the usual method.
:thumbsup: =D>David Singleton0 -
Duikmeester wrote:Did you try it, my sample code? This will create an actual NEW field in Table 4...
Does using code to add field require a re-compile of the table?NAV - Norton Anti Virus
ERP Consultant (not just Navision) & Navision challenger0 -
idiot wrote:Does using code to add field require a re-compile of the table?
Table does not seem to have to be recompiled, the modified time/date/mark however will change.
P.S: I have never used this in real world situation, I just know that this works...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions