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: #root
| Method OnOK () id:Method_DialogCreateEditSalesSegment_OnOK
| {
| #keys: '[135040.0.183113912]'
| Body:
| [*
| // When the user clicks ok,
| // we either create or edit the data
|
| this.ApplyChanges();
|
| data := DataHolderDialogData.Data();
|
| if( isnull( data.WrappedInstance() ) )
| {
|
| salesegment := SalesSegment_MP::Create( data.MacroPlan(),
| data.Parent(),
| data.Name(),
| data.DisplayIndex(),
| false //isfromdb
| );
|
| // Access the form, select new sales segment
| DataHolderForm.Data().ListSalesSegment().SelectByKey( salesegment.Key() );
| }
| else
| {
| data.WrappedInstance().Update( edtName.Text(), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing
| data.Parent(),
| data.DisplayIndex(),
| false //isfromdb
| );
| }
|
| this.Close();
| *]
| }
|
|