| Quintiq file version 2.0 | 
| #parent: #root | 
| Method GetSalesSegmentsByName ( | 
|   String name_fragment | 
| ) remote as owning SalesSegment_MPs | 
| { | 
|   Description: 'Return a series of keys for sales segments instance have name matched with the given string.' | 
|   TextBody: | 
|   [* | 
|     // DWE2 Jul-20-2016 (created) | 
|      | 
|     salessegments := null( SalesSegment_MPs, owning ); | 
|      | 
|     if( name_fragment <> '' ) | 
|     { | 
|       name_fragment := name_fragment.ToLower() | 
|        | 
|       salessegments := selectsortedset( this, SalesSegment_MP, ss,  | 
|                                         ss.Name().ToLower().FindString( name_fragment, 0 ) > -1, | 
|                                         // Sort it decending by DsiplayIndex as workaround for ScrollToSelectedElement in List | 
|                                         -ss.DisplayIndex() );                                            | 
|     } | 
|      | 
|     return &salessegments; | 
|   *] | 
| } |