Customizing a factbox with RECORDID

Zowee
Member Posts: 2
Hello,
Does anyone have any idea how to link a factbox via the RecordID?
The factbox that will be linked, has a field called "Record ID" of the type Text.
For Example, I want to have a factbox on the Customer List. And this factbox can only contain the records where the RecordID-field is the same as the RecordID of the Customer.
Thanks!
Does anyone have any idea how to link a factbox via the RecordID?
The factbox that will be linked, has a field called "Record ID" of the type Text.
For Example, I want to have a factbox on the Customer List. And this factbox can only contain the records where the RecordID-field is the same as the RecordID of the Customer.
Thanks!
0
Comments
-
The FactBoxes are controls accessible from the code. You could write a function in the FactBox page to accept a record id and filter based on it. You could call that function every time you get a record from the database (OnAfterGetRecord).0
-
@mattrax: you're perfectly right, but i've noticed a strange behaviour when you do something like that on lists.
try to create a list based on customers, and a factbox based on customers, too.
Example:
Customer list - onaftergetrecordCustomer.GET("no."); currpage.myfactbox.form.setsourcetable(Customer); currpage.myfactbox.form.update(false);
Customer Factbox - setsourcetable(VAR Customer: Table 18)get(Customer."no.");
Althought this modification is pointless, in my opinion it should work without problems, but it behaves strange (difficult to explain, try it).
It acts even stranger if you set the list to be a worksheet :shock:0 -
I finally had a project where I needed this, and yes, it does not work well. For whatever reason, the OnAfterGetRecord trigger does not fire as you move through the list on a Page object.
My case is a little different. The fact box is unbound, so it has no Source Table. And therefore no SourceTableLink from the main Page.
I need a way to tell that Fact Box / Sub Page what it needs to display, but with no events firing as I move through the record list, I'm not sure it's possible with NAV code. I've tried OnAfterGetRecord, OnFindRecord, OnNextRecord...I can't figure out any trigger that will fire as you move from one record to the next.
Surely there is a solution here...
[Edit] Essentially it only fires for the first line in the list whenever the list is loaded. So OnOpenPage, or when you filter to a new set of values0 -
yes, you got the point matt. The only thing i can say is that i've made a similar page with similar behaviour before (here's the link, 2nd page the last but one post)
http://www.mibuso.com/forum/viewtopic.php?f=5&t=20084
and it worked fine in nav2009sp1.
Now, it seems like the onafter is fired over and over when you open (and probably close, i don't remember) the page, but not when you brows the list(!!onaftergetrecord of card pages work fine, if i remember well).
i thought to report this to MS, but honestly, it's hard to explain because of my basic english skills0 -
Those are good solutions, but they work because there is an explicit action calling the form or page. An OnPush trigger for example. Here there is no event to tell the other page to reload itself.0
-
I even tried creating an add-in for the list page that would raise an event when it lost focus, only to find out that add-ins don't work on list pages. This might be one of the most frustrating things I've encountered. I sort of understand it...it's good not to send a request to the database every time you move from one record to another, but there has to be a way on the page object to fire an event like this.0
-
i totally agree with your frustration and toit's good not to send a request to the database every time you move from one record to another, but there has to be a way on the page object to fire an event like this.0
-
This is a big frustration with me as well. However, I have discovered a couple of things that may help.
-
1. The OnAfterGetRecord trigger is fired as the user moves through the rows of a repeater for a
2. If you link the FactBox to the main page (via the SubformLink property) then the OnFindRecord trigger on the FactBox will fire as the user moves through the rows of the repeater on the main page. You may be able to program the OnFindRecord trigger to do what you need; information about the current record on the main page can be determined by the filters set in filter group 4 on the FactBox.0 -
jreynolds wrote:1. The OnAfterGetRecord trigger is fired as the user moves through the rows of a repeater for a Worksheet type page. However, it does not seem to fire for other page types. Perhaps you can use a worksheet instead of a list.jreynolds wrote:2. If you link the FactBox to the main page (via the SubformLink property) then the OnFindRecord trigger on the FactBox will fire as the user moves through the rows of the repeater on the main page. You may be able to program the OnFindRecord trigger to do what you need; information about the current record on the main page can be determined by the filters set in filter group 4 on the FactBox.0
-
jreynolds wrote:2. If you link the FactBox to the main page (via the SubformLink property) then the OnFindRecord trigger on the FactBox will fire as the user moves through the rows of the repeater on the main page. You may be able to program the OnFindRecord trigger to do what you need; information about the current record on the main page can be determined by the filters set in filter group 4 on the FactBox.
It will fire even if it is not linked. Even if it was linked, though, at that point you would already know the source data and you wouldn't have a generic FactBox anymore.0 -
I think I have actually figured out a way to do this. I have gotten it to work with a very basic example, so now it's off to a much larger test set. I will update if everything works out.0
-
If anyone is still curious, check out the download here: http://mibuso.com/dlinfo.asp?FileID=1380
It uses a generic fact box to do most of the work. You should be able to get the idea of how it works from the code and documentation.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