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
Quintiq file version 2.0
#parent: #root
Method SetBookmarkElement (
  Entitys checkedEntities,
  Product_MPs checkedProducts,
  SalesSegment_MPs checkedSalesSegments,
  const structured_Object periodObject
)
{
  Description:
  [*
    Web introduced new bookmark logic. Keep bookmark as short as possible.
    If all children (and descendants) checked, store the parent only. If partial, then no choice we store the checked children.
  *]
  TextBody:
  [*
    // Save bookmark with parent only when the children are all checked
    entities := Bookmark::GetEntitiesToSave( checkedEntities );
    
    units := selectset( entities, Elements.astype( Unit ), e, true ); // Cast to units
    stocking_points := selectset( entities, Elements.astype( StockingPoint_MP ), e, true ); // Cast to SPs
    products := Bookmark::GetProductsToSave( checkedProducts );
    sales_segments := Bookmark::GetSalesSegmentToSave( checkedSalesSegments );
    
    this.SetBookmarkElement( units, stocking_points, products, sales_segments, periodObject );
  *]
}