Lotus Notes / Domino Sonstiges > Tipps und Tricks
@SetViewInfo - Let users filter any view
Glombi:
Sag mal an, wo der Code ist und was im Code steht.
Welche Notes 6 Version?
Hier aus der Hilfe:
In Standard Outline views, filters a view to display only documents from a specified category. In Calendar views, filters a view to display only document that contain a specified string in a specified column.
Note This @function is new with Release 6.
Syntax
In a Standard Outline view:
@SetViewInfo( [SETVIEWFILTER] ; filterString ; columnName ; isCategory )
In a Calendar view:
@SetViewInfo( [SETVIEWFILTER] ; filterString ; columnName ; exactMatch )
Parameters
[SETVIEWFILTER]
Keyword. Required. Indicates you want to qualify the documents that display in a view.
filterString
Text. Serves as the key to determine which documents display in a view. If this string is present in the column specified in columnName, includes the document in the view.
columnName
Text. The programmatic name of a column. The column specified here must contain the filterString for the document to display in the view.
isCategory
Number. Boolean value. Required in a Standard Outline view; not for use in Calendar views. 1 indicates that the column in the columnName value is a category. 0 indicates that it is not.
exactMatch
Number. Boolean value. Optional in a Calendar view; not for use in Standard Outline views. 1 indicates that the string in the columnName column must exactly match the string specified in filterString. 0 indicates that the filterString does not have to match exactly. For instance, if the filterString is "A," and exactMatch is set to 0, documents with "A" and "A plus" in the column specified in columnName will both be included in the
view.
Usage
This @function is useful if you want to filter the documents in a view to display only a subgroup that contain specific data.
Entscheidend ist aus meiner Sicht:
columnName
Text. The programmatic name of a column.
Andreas
cococo69:
Hallo Andreas,
der Code von Ulrich steht in einer Ansichts-Aktion.
Der Fehler kommt aber nicht durch den @SetViewInfo( [SetViewFilter];.... - Befehl, sondern durch die vorgelagerte Prüfung!?
Armin
--- Zitat ---Dode:
REM { --- this action button filters a view based on the user's input --- };
tmpVName := @Subset( @ViewTitle; -1 );
@If( tmpVName = "";
@Return( @Prompt( [Ok]; "Warning"; "This only works when a database is opened to a view.") );
@Success );
tmpCol := 1;
REM { produce a list of categories from the current view };
tmpList := @Unique( @DbColumn( ""; ""; tmpVName; tmpCol ) );
REM { handle common errors -- reset filtering in an inappropriate view };
warningText := "This action only works in a categorized view where the category is the first column." + @Char(10) +
"This will not work in a flat view or in a view where the first column is not the category";
@If( @IsText( tmpList[1] );
@Success;
@Do( @SetViewInfo( [SetViewFilter]; ""; ""; 1); @Return( @Prompt(
[Ok]; "Warning"; warningText ) ) ) );
REM { Let the user pick one category };
tmpChoice := @Prompt( [OkCancelCombo];
"Select a Category for Filter"; "This will filter the view to a single category." + @Char(13) + " (specify blank for all)";
""; "" : tmpList );
REM { reminder: expand the view or it may appear empty };
@Command( [ViewExpandAll] ) ;
REM { Set the filter (or clear the filter) };
tmpCName := "sPOAreaName";
@SetViewInfo( [SetViewFilter]; tmpChoice; tmpCName; 1 )
--- Ende Zitat ---
eknori (retired):
Habe hier mal schnell ne Demo gebastelt; test mal damit
cococo69:
Hallo Ulrich,
das Problem liegt eindeutig an meiner Ansicht. Die gleiche Aktion in eine andere Ansicht kopiert ---> KEIN Problem!!!
Die genaue Ursache konnte ich allerdings noch nicht lokalisieren!?
Melde mich wieder!
Danke!
Gruß
Armin
Glombi:
Hast Du denn die programmatischen Namen der Spalten geprüft?
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln