rt 4.2.16
[freeside.git] / rt / lib / RT / Record.pm
index 1818c2d..5c0bd14 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -1282,6 +1282,14 @@ sub Customers {
 
       $self->{'Customers'} = $self->MemberOf->Clone;
 
+      my $RecordType = $self->RecordType;
+      my $uri_type = $RecordType eq 'Ticket' ? 'ticket' : "RT::$RecordType";
+
+      $self->{'Customers'}->Limit( FIELD    => 'Base',
+                                   OPERATOR => 'STARTSWITH',
+                                   VALUE    => 'fsck.com-rt://%/'.$uri_type.'/',
+                                 );
+
       for my $fstable (qw(cust_main cust_svc)) {
 
         $self->{'Customers'}->Limit(
@@ -2188,6 +2196,7 @@ sub _AddCustomFieldValue {
         unless ( $new_value_id ) {
             return ( 0, $self->loc( "Could not add new custom field value: [_1]", $msg ) );
         }
+
         if ( $args{'RecordTransaction'} ) {
             my ( $tid, $msg ) = $self->_NewTransaction(
                 Type          => 'CustomField',