automated code-adding tool

charles.roos
Member Posts: 60
Is there an automated tool that adds to several Navision objects at once some code? For example, i want to add to 50 table objects a new function, then is there a program that takes input those 50 objects exported into txt-format, and adds my function to all of those objects by pressing one button? I believe i such program is possible to do, and perhaps is done maybe, but i didn't find in google anything.
0
Comments
-
I don't know if there's a tool, but it's very easy to copy a function within NAV. menu View, C/AL Globals, tab Functions, select function (blue line), then copy and paste it in other object where you need the function. All code and locals are being copied.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
tinoruijs wrote:I don't know if there's a tool, but it's very easy to copy a function within NAV. menu View, C/AL Globals, tab Functions, select function (blue line), then copy and paste it in other object where you need the function. All code and locals are being copied.
But i don't want to copy-paste 50 times or more.0 -
charles.roos wrote:tinoruijs wrote:I don't know if there's a tool, but it's very easy to copy a function within NAV. menu View, C/AL Globals, tab Functions, select function (blue line), then copy and paste it in other object where you need the function. All code and locals are being copied.
But i don't want to copy-paste 50 times or more.
I understand. But I think copying 50 times is faster than searching for a tool which probably, if there is one, has disadvantages and limits.
But that's just my opinion.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
charles.roos wrote:But i don't want to copy-paste 50 times or more.0
-
DenSter wrote:charles.roos wrote:But i don't want to copy-paste 50 times or more.
But what if i need in the future to do such rutine again? There will be 10 such situations again? Can you do time calculations for that too?0 -
charles.roos wrote:DenSter wrote:charles.roos wrote:But i don't want to copy-paste 50 times or more.
But what if i need in the future to do such rutine again? There will be 10 such situations again? Can you do time calculations for that too?
I think it should be an exeption to add the same function to 50 objects.
It's much better to have 1 function in 1 place and call it from 50 different places.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
charles.roos wrote:But what if i need in the future to do such rutine again? There will be 10 such situations again? Can you do time calculations for that too?0
-
tinoruijs wrote:charles.roos wrote:DenSter wrote:charles.roos wrote:But i don't want to copy-paste 50 times or more.
But what if i need in the future to do such rutine again? There will be 10 such situations again? Can you do time calculations for that too?
I think it should be an exeption to add the same function to 50 objects.
It's much better to have 1 function in 1 place and call it from 50 different places.
I want to add such functionality that all matching (by name) fields is copied from any record to any record. For example:
Customer.CopyMatchingFieldsTo(Contact1);
Customer.CopyMatchingFieldsTo(Customer2);
Those 2 functions would copy Name field value from Customer variable to Contact1 and Customer2 variable's Name field. How to achieve this? Also the reverse functionality is needed:
Customer.CopyMatchingFieldsFrom(Contact1);
Customer.CopyMatchingFieldsFrom(Customer2);
This would copy matching fields from any record type to Customer record.
I thought to add to Customer and other tables such function:
"TransferFieldsToRecRef(VAR DestinationRecordRef : RecordRef)"
This function would copy all matching (by name) fields from current table(Rec) object to the parameter, what-ever the type of the parameter is.
The idea would be as:
Customer.CopyMatchingFieldsTo(Contact1Ref);
Contact1.CopyMatchingFieldsFrom(Contact1Ref);
This would copy from Customer record the matching fields to Contact1 record.
To achieve this i thought i should add those CopyTo and copyfrom functions to all tables so i can use them comfortably in the future for all tables. What do you think about this, maybe i have some bad strategy or something.0 -
a bit off topic but perhaps Code Genius 2007 would be someting you like
http://www.mibuso.com/dlinfo.asp?FileID=8750 -
Savatage wrote:a bit off topic but perhaps Code Genius 2007 would be someting you like
http://www.mibuso.com/dlinfo.asp?FileID=875
CodeGenius helps programming in a little way only, it doesn't help with adding into lot of objects the same/similiar code/function as i understand.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