Table FILTER question/problem - CalcFormula SETFILTER

andy76
Member Posts: 616
Dear all,
I am creating a new field in table 27 - Item called "Attachment Presence" that should have a behaviour similar to standard field Comment.
It is a boolean and should be true or false if it exists at least one record in table Record Link No. 2000000068.
In CalcFormula properties I am inserting something like this:
Exist("Record Link" WHERE (Record ID=FILTER()))
but I don't know the right sintax to tell the system this thing
RecordID start with 'Item :' + "No." where:
'Item :' is a fix text
"No." is the key of the table Item (code of article)
If I was writing code directly in C/AL editor the thing could be more simple using %1, %2 and so on....
Do you understand?
Can you help me?
Thank you
I am creating a new field in table 27 - Item called "Attachment Presence" that should have a behaviour similar to standard field Comment.
It is a boolean and should be true or false if it exists at least one record in table Record Link No. 2000000068.
In CalcFormula properties I am inserting something like this:
Exist("Record Link" WHERE (Record ID=FILTER()))
but I don't know the right sintax to tell the system this thing
RecordID start with 'Item :' + "No." where:
'Item :' is a fix text
"No." is the key of the table Item (code of article)
If I was writing code directly in C/AL editor the thing could be more simple using %1, %2 and so on....
Do you understand?
Can you help me?
Thank you
0
Comments
-
Filters in CalcFormulas are hard coded. You can't have a text constant + some field.0
-
How could I solve my problem in another way?
Thank you
Happy Easter0 -
You can't use a flowfield. You'd have to create a normal field and make sure it is updated every time a record is inserted / deleted in the Record Link table.0
-
The real purpose of the development is to display 2 different pictures in Item form to display if there is at least an attachment (stapler_on.bmp) or if there are no attachments (stapler_off.bmp).
I wanted to exploit the logic under the picture Comment with 2 different pencils pictures.
Do you have other suggestions?
A lot of attachment have already been inserted in the system and I cannot set manually the new field, only creating with a massive report but is not very crafty...
Thank you very much.0 -
In table 27 add two new fields:
"Record ID"::RecordID;
"Link Exists"::Boolean - Flow Field;
in the "link Exists" field add the flow field formula "Exist("Record Link" WHERE (Record ID=FIELD(Record ID)))"
Now in the insert, rename and No. fields ad code to update the Record ID field.David Singleton0 -
I was writing the code written on this link:
viewtopic.php?f=1&t=34687&p=200645#p200645
but I have the problem of last reply
Thank you very much0 -
Can nobody help me?
What is wrong?
Thanks0 -
Setting filters on RecordID does not apply. So add a bool return function to recordlink table that you pass your item no. Loop into the recordlink table to query the related field value with your 'Item:'+Item."No." value and exit when true.Ufuk Asci
Pargesoft0 -
Dear ufuk,
thank you for your reply but I don't understand very well....
Should I loop every time all table? I have thousands of record...
Could you please explain better?
Andrea0 -
Being Recordlink a system table, I can not add code to it, isn't it?
Thanks0 -
You can add function to Record Link table. (but it is not important in this case)
NAV help says that you cannot set filters on RecordID but you can apply textfilters on it. So I think you can filter like:RecLink.SETFILTER("Record ID",FORMAT(prec."Record ID"));
I have tested and got no problem.Ufuk Asci
Pargesoft0 -
This seems GOOD !!!
Thank you very much =D> =D>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