How to do a specific SETRANGE
iqbalmad
Member Posts: 180
hi guys:
can you tell me how to proceed
i have to do a SETRANGE which is like zis in pseudocode in a FORM
GLEntry.SETRANGE(G/L Account No.,VAR1)
var1=GLAccount.Code Where GLAccount.Account Type = 1
can you tell me how to proceed
i have to do a SETRANGE which is like zis in pseudocode in a FORM
GLEntry.SETRANGE(G/L Account No.,VAR1)
var1=GLAccount.Code Where GLAccount.Account Type = 1
0
Comments
-
All the records in GLentry have a glaccount where account type is 1 so. It's all the entries in GL. The rest of gl account do not create glentry
Posting,Heading,Total,Begin-Total,End-Total
Did you mean zero? for Posting, or Heading? option feilds start at zero. and zero is for Posting.1 is heading.
and headings do not have any glentry.0 -
iqbalmad wrote:hi guys:
can you tell me how to proceed
i have to do a SETRANGE which is like zis in pseudocode in a FORM
GLEntry.SETRANGE(G/L Account No.,VAR1)
var1=GLAccount.Code Where GLAccount.Account Type = 1
There are only postings for GLAccount."Account type"::Posting in the G/L Entry Table, but if it is the G/L Account table you mean?
Setrange is like a SELECT statement
So you want
GLAccount.SETRANGE("Account Type",GLAccount."Account type"::Posting);Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
My guess David
He probably just wants to see the gl entries for Total GLaccounts only,0 -
The general idea of modelling 1:N relationships (typical LEFT JOIN's) is with nested loops:
CLEAR(recordA); CLEAR(SomeTotalOfRecordB); recordA.SETCURRENTKEY("SomeField"); recordA.SETRANGE("SomeField", 'somevalue'); IF recordA.FIND('-') THEN REPEAT CLEAR(recordB); recordB.SETCURRENTKEY("recordA No."); recordB.SETRANGE("recordA No.",recordA."No."); if recordB.FIND('-') THEN REPEAT SomeTotalOfRecordB += recordB."SomeAmountField"; UNTIL recordB.NEXT=0; UNTIL recordA.NEXT=0;0 -
Yes Miklos but he wants to see that in a form. I guess he could write it into a temp table and display that. But it's going to be very slow.0
-
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
