| Quintiq file version 2.0 | 
| #parent: #root | 
| Method SetAttributesAfterOnApplyData () id:Method_DialogCreateEditOperation_SetAttributesAfterOnApplyData | 
| { | 
|   #keys: '[109478.0.549768960]' | 
|   Body: | 
|   [* | 
|     // Set user attributes based on declarative value binded with the components after on apply data | 
|      | 
|     data := Dialog.Data(); | 
|      | 
|     if( CheckBoxHasUserLotSize.Checked() ) | 
|     { | 
|       data.UserMinimumQuantity( data.MinimumQuantity() ); | 
|       data.HasUserMaximumQuantity( data.HasMaximumQuantity() ); | 
|       data.UserMaximumQuantity( data.MaximumQuantity() ); | 
|       data.UserLotSize( data.LotSize() ); | 
|     } | 
|     /* | 
|     // Delete generated costs which belongs to different unit | 
|     traverse( data, OperationCost, rc, | 
|               isnull( rc.WrappedInstance() ) | 
|               /* There is two sitiuation | 
|                  1) User created an account assignment, we will remove the cost generated for others unit. | 
|                  2) User removed account assignment, we will remove the shadow cost. | 
|                  Guard as: | 
|                  AccountCost.AccountAssignment will be null if the account assignment is being removed, | 
|                  true so the orphan cost will be removed | 
|               and guard( rc.UnitAccount().Unit() <> data.Unit(), true ) ) | 
|     { | 
|       rc.Delete(); | 
|     } | 
|     */ | 
|   *] | 
| } |