Quintiq file version 2.0
#parent: #root
Method AddEdit () id:Method_SWF_DialogCreateEditActivityDefinition_AddEdit
{
  #keys: '[136682.0.1021918776]'
  Body:
  [*
    // Add or Edit data
    //DataholderDialogData will be empty for add 
    
    data := DataHolderDialogData.Data();
    selected_authorization := SWF_AuthorizationBase::GetSelectedAuthorizationFromStringSelections( SWF_WorkflowDataset,
                                                                                                   selstrAssignedTo.Text(),
                                                                                                   Form.GetAuthorizeElement());
                                                                                                       
    service := SWF_WorkflowDataset.Service();
    service.TR_CreateUpdateActivityDefinition( guard( data.ID(), Key::ZeroKey() ), // Zerokey when null data
                                               edtName.Text(),
                                               [Number]numpduedateoffset.Number(),
                                               edtDescription.Text(),
                                               guard( selected_authorization.DisplayName(), '' ),
                                               selParentStepDefinition.Data().ID(),
                                               guard( data.CanGenerateActivity(), true ), // default to can generate activity
                                               guard( data.ViewLink(), '' ),
                                               guard( DropDownListView.Data().Id(), '' ) );
  *]
}
