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