//FieldFilter is a temp table which includes the Filter for every field IF NOT FormRunModal(TableNo,FieldFilter) THEN BEGIN ... end; FormRunModal(TableNo : Integer;FieldFilter : Record) CASE TableNo OF DATABASE::Customer: BEGIN Cust.RESET; //select here the fields an the used filter ... FORM.RUNMODAL(0,Cust); END; ... end;
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
1) You must create a table with the number of fields you want to show.
Its fields are text fields.
The point is the fields you want to show on the form. Suppose the first 5 of the table or something like that. Or you can see some fields that you can set via code using a temporary table of Field table.
2) You create a form based on that table.
3) On OnInit trigger you can write code to copy all records you want to see on a temporary table of the actual Form "Rec", using obviously the Format(fieldRef.value()); Be careful that you must write a loop on the field table to set the value for every field.
4) You can write code on the OnFindRecord and OnNextRecord to substitute Rec (that's a real empty table) with the temporary table. You can find how on the Where-Used form.
Then you set the caption using the Field table and it's done.
Clearly this form must be run after some setting function and so using a variable, not "form.run(formID)".
I think it will work.
If you need to run an existing form you obviously can't do that because it's based on an existing table and the only way to manage is to use "CASE" as you said.
Regards
I posted another solution for this problem to http://www.mibuso.com/forum/viewtopic.php?p=41023
Have fun!
http://navisionfreak.blogspot.com/
Justas Janauskas