Beispiel #1
0
        private PXAction AddAction(string actionName, string displayName, PXButtonDelegate handler)
        {
            var action = PXNamedAction <EDoc> .AddAction(Base, actionName, displayName, handler);

            SurveyFolder.AddMenuAction(action);
            return(action);
        }
        public override void Initialize()
        {
            base.Initialize();

            if (Base.GetType() != typeof(PXGraph) && Base.PrimaryItemType != null)
            {
                PXAction runAction         = PXNamedAction.AddAction(Base, Base.PrimaryItemType, nameof(ConsoleRunAction), "Run", new PXButtonDelegate(ConsoleRunAction));
                PXAction clearOutputAction = PXNamedAction.AddAction(Base, Base.PrimaryItemType, nameof(ConsoleClearOutputAction), "ConsoleClearOutput", new PXButtonDelegate(ConsoleClearOutputAction));
                ConsoleView.Cache.SetValueExt <ConsoleFields.graphType>(ConsoleView.Current, PX.Api.CustomizedTypeManager.GetTypeNotCustomized(Base).FullName); //For code completion on Graph.
            }
        }
        public override void Initialize()
        {
            base.Initialize();

            if (!string.IsNullOrEmpty(Base.PrimaryView))
            {
                Type     primaryViewType = Base.Views[Base.PrimaryView].Cache.GetItemType();
                PXAction updateInsight   = PXNamedAction.AddAction(Base, primaryViewType,
                                                                   "Update Insight", "Update Insight", UpdateInsight);
                updateInsight.SetEnabled(false);
                updateInsight.SetVisible(false);
            }
        }
Beispiel #4
0
        public override void Initialize()
        {
            if (!String.IsNullOrEmpty(Base.PrimaryView))
            {
                //Add a "Test" button in the toolbar
                Type     primaryViewItemType = Base.Views[Base.PrimaryView].Cache.GetItemType();
                PXAction action = PXNamedAction.AddAction(Base, primaryViewItemType, "GlobalTest", "Global Button", TestClick);

                //Liste to FieldUpdating event for NoteText on primary view; we could also do it on every view that has a Note field.
                PXCache primaryViewCache = Base.Caches[primaryViewItemType];
                if (primaryViewCache.Fields.Contains("NoteText"))
                {
                    Base.FieldUpdating.AddHandler(Base.PrimaryView, "NoteText", NoteFieldUpdating);
                }
            }
        }