Change general ledger account

bnielsen
Member Posts: 6
Hi
I have a customer who have a chart of accounts where all accounts starts with 0.
We would like to reverse that decision, and remove all zeros.
That is, change 02010 to 2010, 02020 to 2020 and so on.
It's possible to do that field by field, but as as there is a lot og accounts, we would like to that through C/AL.
Anyone to give some directions..?
I have a customer who have a chart of accounts where all accounts starts with 0.
We would like to reverse that decision, and remove all zeros.
That is, change 02010 to 2010, 02020 to 2020 and so on.
It's possible to do that field by field, but as as there is a lot og accounts, we would like to that through C/AL.
Anyone to give some directions..?
0
Best Answer
-
Through c/al use the statement rename in a report with GLAccount as Dataitem:
if copystr(GLAccount."No.",1,1)='0' then begin
Glaccount.rename(copystr(GLAccount."No.",2,strlen(GLAccount."No.")-1)
end;
Giving thanks is always wellcome5
Answers
-
do they have those '0' in both types Posting and Heading?
0 -
I'm not sure I understand your question :-(
The account number shall be changed both on ledger table, ledger transactions and on any other tables where the original account number is.
When you type a new accountnumber i No. field, NAV askes if you want to change the accountno. - I answer yes to this. But I would like to make a programme to run thru all accounts and delete first zero in the No. field, and on all relations.
Does it make sense?0 -
Through c/al use the statement rename in a report with GLAccount as Dataitem:
if copystr(GLAccount."No.",1,1)='0' then begin
Glaccount.rename(copystr(GLAccount."No.",2,strlen(GLAccount."No.")-1)
end;
Giving thanks is always wellcome5
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