What does "::" operator do ???

emkpro
Member Posts: 47
I feel like a real dumb but I am really clueless, a searhed trough many of the codes in navision demo database still couldn't figure it out :roll:
Can anyone explain it to me ???
Can anyone explain it to me ???
//EMK\\
0
Comments
-
Hi,
The :: is mostly used to access the Option Values of an Option Field in a Table by using their names.
Internally these a stored as integer values, but the style guide does not allow to use the integers in the code directly ( though this will also work) because the code becomes less readable.
It is also used to access the tables by name and not by their table ID
for instance "DATABASE::Item" instead of "27" , when tables
are used as function parameters.Kai Kowalewski0 -
This operator is used with Option fields.
For example, take Table 36-Sales Header
Field Document Type.
In your code, when you want to know wich type of Sales Header you have, you can write :
IF "Document Type" = "Document Type"::Order THEN ...
It's the same as :
IF "Document Type" = 2
but it's more readable ...0 -
:: is called "scope"
Options in Navision are stored as integer values. This means if you would have a field with the options Contact,Customer,Vendor these options are stores as 0,1,2. Note that options start at zero!
So if you now want to set a filter on that field it would like like this:setrange(option, 1)
As you see, this is not quite good to understand. That is way Navision invented the scope!
You can "translate" the (interget) option value to "option::optionvalue"setrange(option, option::Customer)
But be sure the variable / field is known. If not, refer to the right table. See below...salesheader.setrange(option, salesheader.option::Customer)
"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Thanks guys I thought it was something much more complicated :oops:
Say can you give some details on this style guide please ?//EMK\\0 -
emkpro wrote:Say can you give some details on this style guide please ?
The style guide consists of several documents which determine how code, tables, forms and everything else in Navision should be designed in order to maintain the proper "look-and-feel" throughout the application. #-oKai Kowalewski0 -
Hi All,
Another question about "::", because I'd like to get value to option string.
So the Input is a String what is IN(!) the target option field's value.
(GETFILTER(Type))
How can get this value for the option field?
Because I don't like to generate a case function, if its this than do this...
I'd like to get the simple value for the option field.
Type := Type::GETFILTER(Type) or similar this. But this is not works of course.
Thank you!
A0 -
May be better will be create new thread for that, else you can wait for answer too long. This thread is two years dead... :-)
Answer: try this (if you have just one-value filter):EVALUATE(Type,GETFILTER(Type));
0 -
Thanks kine,
I know this thread was dead, but I don't want to open a new thread because the topic is same
I tried this and works! Thanks again
A0
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
- 322 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