Exemplo n.º 1
0
 public void AddedToFlow()
 {
     if ((this.Flow != null) && (this.FlowStep != null))
     {
         FlowEditService.SetDefaultStepName(this.Flow, this.FlowStep, StringUtils.SplitCamelCaseString(StepName) + " {0}");
     }
 }
Exemplo n.º 2
0
        public void Initialize()
        {
            ORM <Folder> orm    = new ORM <Folder>();
            Folder       folder = (Folder)orm.Fetch(typeof(Folder), CRM_LIST_FOLDER_ID);

            if (folder == null)
            {
                Log log = new Log("MSCRM 2011 Folder Behavior");
                log.Debug("Creating System Folder '" + CRM_LIST_FOLDER_ID + "'");
                folder = new Folder(CRM_LIST_FOLDER_ID, "MSCRM 2011", Constants.INTEGRATIONS_FOLDER_ID);
                folder.FolderBehaviorType = typeof(CRM2011FolderBehavior).FullName;

                orm.Store(folder);
            }

            ORM <PageData> pageDataOrm = new ORM <PageData>();
            PageData       pageData    = pageDataOrm.Fetch(new WhereCondition[] {
                new FieldWhereCondition("configuration_storage_id", QueryMatchType.Equals, CRM_PAGE_ID),
                new FieldWhereCondition("entity_folder_id", QueryMatchType.Equals, CRM_LIST_FOLDER_ID)
            }).FirstOrDefault();

            if (pageData == null)
            {
                pageData = new PageData {
                    EntityFolderID         = CRM_LIST_FOLDER_ID,
                    ConfigurationStorageID = CRM_PAGE_ID,
                    EntityName             = "MSCRM 2011 Entities",
                    Order = -1
                };
                pageDataOrm.Store(pageData);
            }

            // This generated types folder will be shared with the 2016 module:
            Folder typesFolder = orm.Fetch(CRM2011Entity.CRM_GENERATED_TYPES_FOLDER_ID);

            if (typesFolder == null)
            {
                Log log = new Log("MSCRM 2011 Folder Behavior");
                log.Debug("Creating System Folder '" + CRM2011Entity.CRM_GENERATED_TYPES_FOLDER_ID + "'");
                typesFolder = new Folder(CRM2011Entity.CRM_GENERATED_TYPES_FOLDER_ID, "MSCRM", Constants.DATA_STRUCTURES_FOLDER_ID);
                orm.Store(typesFolder);
            }

            FlowEditService.RegisterModuleBasedFlowStepFactory(new CRM2011StepsFactory());
        }