Quintiq file version 2.0
#parent: #root
Method ExecuteProfiles (
  structured[UserImportProfile] importprofiles
) id:Method_DialogUserImportProfile_ExecuteProfiles
{
  #keys: '[132894.0.197603864]'
  Body:
  [*
    // execute import profiles
    uniqueimportobjectgroups := BaseImportProfile::GetUniqueImportObjectGroupInProfiles( importprofiles );
     
    // get file paths to upload
    importobjectgroupsfromexcel := selectset( uniqueimportobjectgroups, Elements, e,
                                              e.Source() = MPSyncUtility::ID_Source_Excel() );
    
    binaryvalues := construct( BinaryValues );
    brokers := construct( Strings );
    
    if ( importobjectgroupsfromexcel.Size() > 0 )
    {
      Dialog.ImportFiles( importobjectgroupsfromexcel, &binaryvalues, brokers );
    }
    
    MPSync.ExecuteUserImportProfiles( null( MacroPlan ),
                                      importprofiles,
                                      uniqueimportobjectgroups,
                                      true,     // IsRefreshFromSource
                                      true,     // IsOverwriteManualConfig
                                      binaryvalues,
                                      brokers );
  *]
}
