admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
  *]
}