<%doc> Example: include( '/elements/search-svc_broadband.html, 'field' => 'svcnum', #slightly deprecated old synonym for field#'field_name'=>'svcnum', 'find_button' => 1, #add a "find" button to the field 'curr_value' => 54, #current value 'value => 32, #deprecated synonym for curr_value ); % if ( $opt{'find_button'} ) { % } <% include('/elements/xmlhttp.html', 'url' => $p. 'misc/xmlhttp-svc_broadband-search.cgi', 'subs' => [ 'smart_search' ], ) %> <%init> my( %opt ) = @_; my $field = $opt{'field'} || $opt{'field_name'} || 'svcnum'; my $value = $opt{'curr_value'} || $opt{'value'}; my $svc_broadband = ''; if ( $value ) { $svc_broadband = qsearchs({ 'table' => 'svc_broadband', 'hashref' => { 'svcnum' => $value }, #have to join to cust_main for an agentnum 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, }); }