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
27
28
29
30
31
32
33
34
35
36
37
38
39
Quintiq file version 2.0
#parent: ListTrip
Response OnDropEmpty (
  structured[ProductInStockingPointInPeriodPlanningLeaf] information
) id:Response_ListTrip_OnDropEmpty
{
  #keys: '[113694.0.1639603265]'
  Body:
  [*
    // Create Trips by droping PISPIPs on empty place
    trip := null( Trip );
    legcounter := 0
    
    if( information.Size() = 1 )    // Skip counter if more than one pispip is selected.
    {
      legcounter := counter( information, Elements.ProductInStockingPoint_MP.LaneLegOutput.LaneLeg, leg, leg.GetIsEnabled() );
    }
    
    // If only 1 pispip is selected and there is more than one leg, prompt the dialog for user to select a leg.
    if( legcounter > 1 )
    {
      dlg := construct( DialogCreateEditTrip );
      trip := dlg.NewTripWithProduct( this, information.Element( 0 ) );
    }
    else
    {
      // Create trips with products in trip based on PISPIPs
      trip := Trip::CreateWithProductInTrips( information, null( LaneLeg ) );
    }
    
    ApplicationLibMacroPlanner.AutoExpandSelection( ListTrip, trip );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_List_OnDropEmpty'
  Precondition:
  [*
    return Trip::CanCreate( information, feedback );
  *]
}