reports

suri
Member Posts: 123
hi superiors
i have the following question as shown below.
Report to enter the Account No. in "Consol. Debit Acc." and "Consol. Credit Acc." for all acounts in chart of Accounts
i have taken a new report
with data item
g/l account
property:processing only=yes;
i have written the code
onafter get record()
IF "G/L Account".FIND THEN
BEGIN
REPEAT
"G/L Account".INIT;
"G/L Account"."Account Type":="G/L Account"."Account Type"::Heading;
"G/L Account"."Consol. Debit Acc." :="G/L Account"."No.";
"G/L Account"."Consol. Credit Acc." :="G/L Account"."No.";
"G/L Account".INSERT;
"G/L Account".RESET;
UNTIL "G/L Account".NEXT=0;
END
ELSE
MESSAGE('no records');
it was throwing the error,i was week at coding .can you suggest me the process where i have done wrong
thank you
error:
the g/l account entry already exists
with no :1000
i have the following question as shown below.
Report to enter the Account No. in "Consol. Debit Acc." and "Consol. Credit Acc." for all acounts in chart of Accounts
i have taken a new report
with data item
g/l account
property:processing only=yes;
i have written the code
onafter get record()
IF "G/L Account".FIND THEN
BEGIN
REPEAT
"G/L Account".INIT;
"G/L Account"."Account Type":="G/L Account"."Account Type"::Heading;
"G/L Account"."Consol. Debit Acc." :="G/L Account"."No.";
"G/L Account"."Consol. Credit Acc." :="G/L Account"."No.";
"G/L Account".INSERT;
"G/L Account".RESET;
UNTIL "G/L Account".NEXT=0;
END
ELSE
MESSAGE('no records');
it was throwing the error,i was week at coding .can you suggest me the process where i have done wrong
thank you
error:
the g/l account entry already exists
with no :1000
0
Comments
-
You need to Modify the record and not Insert..
Just assign the values to field in OnAfterGet Record trigger and modify the record.
no need to find the record etc..0 -
ya mohana sir
thanks for giving reply .this code helped me .
"G/L Account"."Consol. Debit Acc." :="G/L Account"."No.";
"G/L Account"."Consol. Credit Acc." :="G/L Account"."No.";
"G/L Account".MODIFY;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