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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Quintiq file version 2.0
#parent: #root
Method ExecuteEntitiesBrokers (
  Boolean isexcel,
  BinaryValues binarydatas,
  Strings brokers
)
{
  Description: 'Execute brokers that are associated with objects in Entities ObjectGroup'
  TextBody:
  [*
    if( not isexcel )
    {
      this.MPSync().MPSync_ImportEntitiesFromDBBroker().Execute();
    }
    else
    {
      brokername :="";
      try
      {
        // Groups
        brokername := typeof( MPSync_ImportGroupsFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportGroupsFromExcelBroker().Source(),
                             binaryvalue );  
        this.MPSync().MPSync_ImportGroupsFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
        
        // Sales segments
        brokername := typeof( MPSync_ImportSalesSegmentsFromExcelBroker ).Name();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportSalesSegmentsFromExcelBroker().Source(),
                             binaryvalue );  
        this.MPSync().MPSync_ImportSalesSegmentsFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );  
      }  
      
      try
      {
        // Stocking points
        brokername := typeof( MPSync_ImportStockingPointsFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportStockingPointsFromExcelBroker().Source(),
                             binaryvalue );  
        this.MPSync().MPSync_ImportStockingPointsFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }
        
      try
      {
        // Units
        brokername := typeof( MPSync_ImportUnitsFromExcelBroker ).ShortName();
        binaryvalue := this.GetBinaryData( binarydatas, brokers, brokername );
        this.ValidateBroker( brokername,
                             this.MPSync().MPSync_ImportUnitsFromExcelBroker().Source(),
                             binaryvalue );  
        this.MPSync().MPSync_ImportUnitsFromExcelBroker().ExecuteFromXLS( binaryvalue.AsBinaryData(), true );
      }
      onfailure
      {
        this.UpdateLastExecutedImportObjectGroupErrorMessage( brokername + ":" + e.GeneralInformation() );
      }
    }
  *]
  InterfaceProperties { Accessibility: 'Extensible' }
}