30. Januar 2006 16:17
FILTERGROUP := 2;
30. Januar 2006 16:30
30. Januar 2006 16:42
30. Januar 2006 17:37
30. Januar 2006 19:19
Navision C/SIDE Reference Guide hat geschrieben:FILTERGROUP (Record)
Use this function to change the filter group that is being applied to the table. You can also use this function to return the number of the current filtergroup. You cannot return the number of the filtergroup and set a new filtergroup at the same time.
A filtergroup can contain a filter for a Record that has been set earlier with SETFILTER or SETRANGE. The total filter applied is the combination of all the filters set in all the filtergroups.
[CurrGroup] := Record.FILTERGROUP([NewGroup])
CurrGroup
Data type: integer
The number of the current filter group.
Record
Data type: record
A record pointing to the table you want to work with.
NewGroup
Data type: integer
The number of the filter group you want to use.
Settings
There are filtergroups with numbers from 0 to 255.
Comments
When you select a FILTERGROUP, subsequent filter settings - by SETFILTER or SETRANGE - apply to that group.
All groups are active at all times. The only way to disable a group is to remove the filters set in that group.
Filters in different groups are all effective simultaneously; that is: if in one group, a filter is set on customer numbers 1000..2000, while in another group, a filter is set on customer numbers 1800..3000, the result will be that only numbers in the range 1800..2000 are visible.
C/SIDE uses 7 FILTERGROUPS internally:
Number / Name
Description
0 / Std
The default group where filters are placed when no other group has been selected explicitly. This group is used for filters that can be set from the filter dialogs by the end user.
This group is also used for the filtering action that is the result of the RunFormLink property on a form.
1 / Global
Not used, but may be used in the future.
2 / Form
Used for the filtering actions that result from the SETTABLEVIEW function; from the SourceTableView property; and from the DataItemTableView property.
3 / Exec
Used for the filtering actions that result from the SubFormView and RunFormView properties.
4 / Link
Used for the filtering actions that result from the DataItemLink and SubFormLink properties.
5 / Temp
Not used, but may be used in the future.
6 / Security
Used for applying security filters for user permissions.
This means that a filter set in a group different from FILTERGROUP 0 cannot be changed by a user that uses a filter dialog to set a filter. If, for example, a filter has been set on customer numbers 1000..2000 in group 4, the user can set a filter that delimits this selection further, but cannot widen it to include customer numbers outside the range 1000..2000.
It is possible to use one of the internally used groups from C/AL. If you do this, keep in mind that in this way, you will replace the filter that C/SIDE assumes is in this group. If, for example, you use FILTERGROUP 4 in a form, you will replace the filtering that is actually the result of applying the SubFormLink property. This could seriously alter the way forms and subforms interact.
8. März 2006 20:54
8. März 2006 21:17
IF CurrForm.LOOKUPMODE THEN BEGIN
TempFilterText := GETFILTER("Zu schützendes Feld");
FILTERGROUP(2);
SETFILTER("Zu schützendes Feld",TempFilterText);
FILTERGROUP(0);
TempFilterText := GETFILTER("Nächstes Feld");
FILTERGROUP(2);
SETFILTER("Nächstes Feld",TempFilterText);
FILTERGROUP(0);
// [...]
END;
9. März 2006 17:03
Mikka hat geschrieben:Um das Problem in den Griff zu bekommen, habe ich versucht mit FILTERGROUP die Ansicht für den User einzuschränken, so das dieser nur die Lieferadressen zu diesen Debitoren sehen kann.
Leider musse ich feststellen, das jeglicher Versuch mit FILTERGROUP keinen Erfolg brachte.
10. März 2006 09:52
mikka hat geschrieben:... habe ich mich gewundert, das es nicht Funktioniert mit dem FILTERGROUP.
Heute schau ich nochmal über den Code und mußte festellen, dass ich diesen dummerweise auf dem OnCloseForm() Trigger abgelegt habe.