Exemplo n.º 1
0
        private string FormatNumberForKPIDisplay(decimal value)
        {
            var formatedVal = ThisForm.CallGlobalScript("CRMFormatNumberForKPI",
                                                        value.ToString(), string.Empty, string.Empty, string.Empty, string.Empty,
                                                        string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                        string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                        string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);

            return(formatedVal);
        }
Exemplo n.º 2
0
        /// <summary>
        ///    An overrideable method that handles setting the title of the dialog.
        ///
        ///    It does this by checking if the variable, whose name is defined in the form-class' constructor, has a value, if it does,
        ///    then use that, else use the form's caption as the title.
        ///
        ///    To define a default caption go to Edit > Variables on an inheriting form and override the variable value. This defines a default
        ///    caption for the form, but still allows a parent form to provide their own value, if needed.
        ///
        ///    This method is overrideable incase the logic for setting the title of the form, needs to vary; because the for is overrideable the
        ///    form event handlers don't need to be touched to customize this.
        /// </summary>
        public virtual void SetTitle()
        {
            var result = ThisForm.CallGlobalScript("CRMSetDialogTitleControlCaption",
                                                   titleComponentName, ThisForm.Variables(titleVariableName).Value, string.Empty, string.Empty, string.Empty,
                                                   string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                   string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                   string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);

            if (result == "-1")
            {
                Application.DiagnosticsLog("title not set.");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Leverages the global script, CRMHandleMenuRouting, to help parse out the menu item data. This method is called whenever the form loads and when an item is selected.
        /// </summary>
        public void SelectSubForm()
        {
            var action = ThisForm.CurrentIDOCollection.GetCurrentObjectProperty("Action");

            if (!string.IsNullOrWhiteSpace(action))
            {
                var menuData = new CrmMenuData()
                {
                    OkCancelOptional = ThisForm.CurrentIDOCollection.GetCurrentObjectProperty("OkCancelOptional"),
                    ActionType       = "Form",
                    Action           = action,
                    SetVariables     = ThisForm.CurrentIDOCollection.GetCurrentObjectProperty("SetVariables")
                };
                ThisForm.Variables("VarMenuData").SetValue(JsonHelper.Serialize <CrmMenuData>(menuData));

                ThisForm.CallGlobalScript("CRMHandleMenuRouting", "VarMenuData", "frmContainer", string.Empty, string.Empty, string.Empty,
                                          string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                          string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                          string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
            }
        }