-L<RT::Record> object on which to call C<AddAttribute>. If you don't provide
-C<Object> or it's undefined, C<< RT->System >> will be used.
+L<RT::Record> object or a subroutine reference that returns an object on which
+to call C<AddAttribute>. If you don't provide C<Object> or it's undefined,
+C<< RT->System >> will be used.
+
+Here is an example of using a subroutine reference as a value for Object:
+
+ @Attributes = ({
+ Name => 'SavedSearch',
+ Description => 'New Tickets in SomeQueue',
+ Object => sub {
+ my $GroupName = 'SomeQueue Group';
+ my $group = RT::Group->new( RT->SystemUser );
+
+ my( $ret, $msg ) = $group->LoadUserDefinedGroup( $GroupName );
+ die $msg unless $ret;
+
+ return $group;
+ },
+ Content => {
+ Format => <<' END_OF_FORMAT',
+ ....
+ END_OF_FORMAT
+ Query => "Status = 'new' AND Queue = 'SomeQueue'",
+ OrderBy => 'id',
+ Order => 'DESC'
+ },
+ });