Kevin Kok Khah Whey
2023-09-25 34d29be6a3eb0c025da50b77f2107c4ad259c6c0
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
Quintiq file version 2.0
#parent: liH_Forecast
Response OnDoubleClick (
  H_OrderForecastRealQty selection
) id:Response_liH_Forecast_OnDoubleClick
{
  #keys: '[414724.0.111761136]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebList_OnDoubleClick'
  QuillAction
  {
    Body:
    [*
      SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmOrderForecast" and Obj.ItemKey()="ListSelect");
      if( isnull( SelectItem))
      {
         MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect",
                                     ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                       .Add( "Util",selection.Unit())
                                                                       .Add( "CustomCode",selection.CustomCode())
                                                                       .Add( "CustomName",selection.CustomName())
                                                                       .Add( "ForecastQty",selection.ForecastQty())
                                                                       .Add( "ForecastID",selection.ID())
                                                                       .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
      }
      else
      {
        SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                                 .Add( "Util",selection.Unit())
                                                 .Add( "CustomCode",selection.CustomCode())
                                                 .Add( "CustomName",selection.CustomName())
                                                 .Add( "ForecastQty",selection.ForecastQty())
                                                 .Add( "ForecastID",selection.ID())
                                                 .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
      }
      
      jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month());
      if(jResult.Get( "Status").GetBoolean())
      {
        Application.OpenForm( "FrmMaterial","popout");
      }
      else
      {
        WebMessageBox::Warning( jResult.Get( "Msg").GetString());
      }
    *]
    GroupServerCalls: false
  }
}