Display multiple values from flowfiled as concatenated strin

Nikola
Member Posts: 7
Hi
I'm new to this
I have a FlowField with Lookup that returns multiple values
how do i concatenate the returned multiple values in a single comma separated string to display on the item card
Thanks
Nik
Display multiple values from flowfiled as concatenated string on page
C/AL; Flowfields; Flowfilter
I'm new to this
I have a FlowField with Lookup that returns multiple values
how do i concatenate the returned multiple values in a single comma separated string to display on the item card
Thanks
Nik
Display multiple values from flowfiled as concatenated string on page
C/AL; Flowfields; Flowfilter
0
Comments
-
Nikola wrote:I have a FlowField with Lookup that returns multiple values0
-
If these records (or probably only a specific field) are what you would like to display in "a single comma separated string" then I wonder why you are using the FlowField functionality and not code this.
I just was not sure how to go about this, I do not want the user to drill down to see the records, I already have that functionality.
I want the user to just see a string of all records in format "1, 2, 3"
Eventually I want the 1 and 2 and 3 to be links to external pdf documents on which the user can click from the Item card.
I'm so new to this that i know what i can and want to do but just not to sure where and how.If you can recommend literature to read or point me to some examples on this I would appreciate it.0 -
ok
So i did some reading
and
Created variable for the recordset and for the string on the item card page
and did this code in the OnAfterGetRecord()// TEST CATALOG PAGE //_Catalog_Pages - Record variable //_Catalogs_String - Code(50) variable _Catalog_Pages.SETRANGE("No.","No."); IF _Catalog_Pages.FINDSET THEN BEGIN REPEAT _Catalogs_String := _Catalogs_String + ',' + _Catalog_Pages.Page; UNTIL _Catalog_Pages.NEXT = 0; END; _Catalogs_String := DELCHR(_Catalogs_String,'<',',');
is this the right way to do this? is this the right trigger to use? will this create huge performance issue? is there a better way to do this?
should i put this into a global function so i can call it from other places (like "Item List" or on other pages like fact boxes...)
Thanks for your help, this is only my second day working in NAV.0 -
Nikola,
Your work around is ok. It's better to avoid coding in "OnAfterGetRecord" trigger, but there are some unavoidable situations. Anyway, as it's on the "Card" page, there won't be any performance issue (because card page reads only one record at a time.). As it's only a few lines of code, it's ok to be inline than creating a global function.
BR,
MMV0 -
what if i want to do this on Item List, will this be ok there, where i have 10000 records, which trigger is best to use then?0
-
BlackTiger wrote:OnAfterGetRecord() is the only option.
The only suggestion is to create a flowfield which counts number of linked records and do not call your code if number of records is 0.
The BEST option is to figure out a way to make this look/feel like it belongs in NAV, and such a string is NOT it. If they really insist on having the string there, I would create a function in the Item card that returns the string, and set a textbox on the form to this function.
Let's link this to the same discussion on DUG: http://dynamicsuser.net/forums/t/66522.aspx0 -
thats what i did
thanks.
we chose nav because of its flexibility to allow modifications, It is very important for our business for such information to be available right away.
this is just one of several that we need to display this way. I will have at least 4-5 more that will use the same logic0 -
The only suggestion is to create a flowfield which counts number of linked records and do not call your code if number of records is 0.
Thanks i already have the filed and sounds logical to use it in that way so it does not create unnecessary calls to the function.0 -
Looks good, it just doesn't look like it belongs in NAV. Don't get me wrong, I am glad you found a way to make it work, I just question the design of the solution.
The issue that I have with that is that it feels chaotic, not intuitive. This particular one looks like this, another one will look slightly different, and none of it looks like it belongs in NAV, so users will have to be trained on every individual modification. I'd have a count or a sum lookup flowfield that would show as a hyperlink on the page and when you click that it automatically pops up a drilldown page, without writing any code. From a development standpoint this is an easy change that you only do in the table, and it is inherited on all pages that use the table. Users already know about flowfields, they already know they can drill down, they already know what should happen. Add one to a page and they will recognize it immediately and know intuitively how to use it.
Also, you probably programmed this on the page. This means that for the next page for the table, you will have to do the same programming there. Now you have issues with maintenance, what happens when you have to make a change to one of them, will you remember to also update the other pages? Also, you are limited by the maximum length of the string. Have enough catalog pages over time and at some point the string will be too long to display like that. The problem with that is that the compiler will not warn you about that, you will know about it when the user gets an datatype overflow runtime error message.
For me it pays to design it like it belongs in NAV, I'll always push for that. In the end I feel strongly you will have the best user acceptance, and maximum efficiency using the program. You're right though, you paid for the ability to modify it however you see fit.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