Hi folks!
I currently have a slight problem with a RecRef: I would like to show it in a form.
During runtime I know which form I would have to run, but how do I get the filters of the RecRef to filter the Recs shown on the form.
For instance:
RecRef.Open(27);
FieldRef := RecRef.FIELD(1);
FieldRef.SETRANGE(RandomFilter);
FORM.RUN(31);
I would like to filter the Form with the same Filter I use on the RecRef WITHOUT having to define a variable for almost every Table in the System...
Comments
:P
What do you try to do in the first place? why do you need to open lots of different forms with a recref instance?
viewtopic.php?t=9247
However; I would never dare use it in a production environment...
Peter
If you just need to show records and not edit something i would recomend to use a temporary table add like 100 textfields , fill this table based on the recordref with records and show this in the form... The captions can you get from recref too and send it to form and apply that on runtime.
SetRecRefFilter
GetRecRefFilter
Before calling the form you use SetRecFilter to save the actual filter from the recref
In OnOpenForm you use GetRecFilter to read the filter from the single instance codeunit
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I like the idea. Why wouldn't you use it in a production environment?
Nevertheless: Thanks for the input everyone!
P.S.: i've just seen that he said "Even with several concurent users".
Anyway, i'd go for garak's solution, if possible
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
nothing new to say about running form(0) with a recordref variable. forms are designed to show data from a specific record, so it's a matter of design.
but, thinking about the standar, i remembered using the Setup Checklist function, under Administration, Application Setup, General, Setup Checklist menu. i thought this could fit most of my requirements...
my case: we are designing an interface to retrieve data from AS400 to Dynamics via ODBC. we design a simple, intermediate table in which inserting several equivalencies between Dynamics and AS400, with three columns: Table Id, Code, Eq. Code, for saving table id from Dynamics, code from this table in Dynamics and code from AS400. when in Code column, it would be great if we could open the form(0) of the table shown in our Table Id column.
this is where Setup Checklist must play its role. we use the standard functionallity to call codeunit 406, using a record variable pointing to table 344, so we can open the corresponding form and view data from that table. it's not possible to retrieve codes (...yet ...) but we could copy and paste.
not the best solution but it works, with two lines of code.
hope it could help.
so far, so good