/// <summary>
        /// Downloads an attachment.
        /// Generates the "AttachmentConfirmDownload" event.
        /// </summary>
        public void AttachmentDownload()
        {
            var prime = ThisForm.PrimaryIDOCollection;

            if (prime == null)
            {
                return;
            }
            if (prime.GetSubCollection(AttachmentSubcollectionName, -1).GetCurrentObjectProperty("DocumentType") ==
                "URL")
            {
                ThisForm.GenerateEvent("AttachmentGoToURL");
            }
            else
            {
                if (string.IsNullOrEmpty(prime.GetSubCollection(AttachmentSubcollectionName, -1)
                                         .GetCurrentObjectProperty("DocumentObject")))
                {
                    Application.ShowMessage(Application.GetStringValue("sAttachmentContentEmpty"));
                }
                else
                {
                    ThisForm.Components[AttachmentGridColName].BlobFormat = prime
                                                                            .GetSubCollection(AttachmentSubcollectionName, -1)
                                                                            .GetCurrentObjectProperty("DocumentExtension");
                    ThisForm.GenerateEvent("AttachmentConfirmDownload");
                }
            }
        }
Beispiel #2
0
        //set adjustment value with the stored value user entered
        private void SetAdjustmentValue()
        {
            string[] productIDs  = ThisForm.Variables("VarProductIDs").Value.Split(',');
            string[] locationIDs = ThisForm.Variables("VarLocationIDs").Value.Split(',');
            string[] adjustments = ThisForm.Variables("VarAdjustments").Value.Split(',');
            string[] reasons     = ThisForm.Variables("VarReasons").Value.Split(',');

            int adjIndex = 0;

            for (int i = 0; i < adjustments.Length; i++)
            {
                //iterate through grid looking for matching productID and locationID
                ThisForm.PrimaryIDOCollection.First();
                for (int j = 0; j < ThisForm.PrimaryIDOCollection.GetNumEntries() - 1; j++)
                {
                    string productID  = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("ProductID");
                    string locationID = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("LocationID");

                    //Application.ShowMessage(i + "\n" + adjIndex + "\n" + productID + " " + productIDs[adjIndex] + "\n" + locationID + " " + locationIDs[adjIndex] + "\n" + adjustments[adjIndex]);
                    if (productID.Equals(productIDs[adjIndex]) && locationID.Equals(locationIDs[adjIndex]))
                    {
                        ThisForm.PrimaryIDOCollection.SetCurrentObjectProperty("Adjustment", adjustments[i]);
                        ThisForm.PrimaryIDOCollection.SetCurrentObjectProperty("Reason", reasons[i]);
                        continue;
                    }
                    ThisForm.PrimaryIDOCollection.Next();
                }
                adjIndex++;
            }
        }
 public void ForceAttachmentRefresh(IWSIDOCollection collection)
 {
     Application.DiagnosticsLog("ManualRefresh: calling refresh current object");
     ThisForm.Variables("VarFilePanelPointer").SetValue(DateTime.Now.Ticks.ToString());
     ThisForm.Components["crmFiles"].InvalidateList();
     collection.GetSubCollection(AttachmentSubcollectionName, -1).Refresh();
 }
Beispiel #4
0
        /// <summary>
        /// This takes the values from the CRMMenuHandleRouting Global Script, which does the generic Menu item parsing and applies
        /// more process specific logic to the data to build up the needed form signatures.
        /// </summary>
        public void ExpandRoute()
        {
            var nextForm  = ThisForm.Variables("VarFormRoute").Value;
            var variables = ThisForm.Variables("VarSetVariables").Value;

            var key = PullKeyFromChild();

            if (!string.IsNullOrWhiteSpace(key))
            {
                if (!key.StartsWith("FILTER("))
                {
                    variables = string.Format("{0},{1}", variables, key);
                    key       = string.Empty;
                }
                else
                {
                    variables = variables.Replace("InitialCommand=Add,", string.Empty).Replace("InitialCommand=Add", string.Empty);
                    variables = variables.Replace("InitialCommand = Add,", string.Empty).Replace("InitialCommand = Add", string.Empty);
                    if (!variables.Contains("InitialCommand"))
                    {
                        variables = string.Format("InitialCommand=Refresh,{0}", variables);
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(variables))
            {
                variables = string.Format("SETVARVALUES({0})", variables);
            }
            var path = string.Format("{0}(CONTAINER(frmContainer) {1} {2})", nextForm, variables, key);

            ThisForm.Variables("VarFormPath").SetValue(path);
            ThisForm.GenerateEvent("CRMGoToForm");
        }
Beispiel #5
0
        public void FilterByAdjustment()
        {
            string filter = String.Empty;

            string[] productIDs  = ThisForm.Variables("VarProductIDs").Value.Split(',');
            string[] locationIDs = ThisForm.Variables("VarLocationIDs").Value.Split(',');
            string[] lotCodes    = ThisForm.Variables("VarLotCodes").Value.Split(',');
            if (ThisForm.Variables("VarReadyToConfirmAdjustments").Value.Equals("1"))
            {
                for (int i = 0; i < productIDs.Length; i++)
                {
                    if (i == 0)
                    {
                        filter = "(ProductID = '" + productIDs[i] + "' AND LocationID = '" + locationIDs[i] + "')";
                    }
                    else
                    {
                        filter += " OR (ProductID = '" + productIDs[i] + "' AND LocationID = '" + locationIDs[i] + "')";
                    }
                }
                Application.ShowMessage(filter);
            }

            ThisForm.PrimaryIDOCollection.Filter = filter;
            ThisForm.PrimaryIDOCollection.Refresh();

            SetAdjustmentValue();
        }
Beispiel #6
0
        //set count value with the stored value user entered
        private void SetCountValue()
        {
            string[] productIDs  = ThisForm.Variables("VarCountProductID").Value.Split(',');
            string[] locationIDs = ThisForm.Variables("VarCountLocationID").Value.Split(',');
            string[] counts      = ThisForm.Variables("VarCount").Value.Split(',');
            int      countIndex  = 0;

            foreach (String count in counts)
            {
                //iterate through grid looking for matching productID and locationID
                ThisForm.PrimaryIDOCollection.First();
                for (int i = 0; i < ThisForm.PrimaryIDOCollection.GetNumEntries() - 1; i++)
                {
                    string productID  = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("ProductID");
                    string locationID = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("LocationID");

                    //Application.ShowMessage(i + "\n" + countIndex + "\n" + productID + " " + productIDs[countIndex] + "\n" + locationID + " " + locationIDs[countIndex] + "\n" + counts[countIndex]);
                    if (productID.Equals(productIDs[countIndex]) && locationID.Equals(locationIDs[countIndex]))
                    {
                        ThisForm.PrimaryIDOCollection.SetCurrentObjectProperty("CountQuantity", count);
                        continue;
                    }
                    ThisForm.PrimaryIDOCollection.Next();
                }
                countIndex++;
            }
        }
Beispiel #7
0
        public void LoadDatesandTimes()
        {
            Application.DiagnosticsLog("KC_VarDt:" + ThisForm.Variables("VarDtModified").Value);
            Application.DiagnosticsLog("KC_VarDt:" + ThisForm.Variables("VarDtCreated").Value);

            var currentUser = Application.Variables("VarCRMUserID").GetValueOfString(string.Empty);

            if (string.IsNullOrEmpty(currentUser))
            {
                currentUser = Application.Variables("VarMGUserName").GetValueOfString(string.Empty);
            }
            LoadCollectionResponseData loadResponse = IDOClient.LoadCollection("CRMUserNames", "CRMUserID,LocalTimeZone",
                                                                               string.Format("CRMUserID = '{0}' OR Username = '******'", currentUser), "", 0);
            var timeZone = TimeZoneInfo.Local.Id;

            if (loadResponse.Items.Count > 0)
            {
                timeZone = loadResponse[0, 1].Value;
                Application.DiagnosticsLog(string.Format("User '{0}' time zone set to: {1}", currentUser, timeZone));

                if (string.IsNullOrEmpty(timeZone))
                {
                    // Fall back to local time
                    timeZone = TimeZoneInfo.Local.Id;
                    Application.ShowMessage(Application.GetStringValue("mUserTimeZoneNotSet"));
                }
            }

            var now          = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, timeZone);
            var modifiedDate = ThisForm.Variables("VarDtModified").GetValueOfDateTime(RoundUp(now, TimeSpan.FromMinutes(5)));
            var createdDate  = ThisForm.Variables("VarDtCreated").GetValueOfDateTime(RoundUp(now, TimeSpan.FromMinutes(5)));

            ThisForm.Variables("VarDtModified").SetValue(ConvertDtToTimeZone(modifiedDate, timeZone));
            ThisForm.Variables("VarDtCreated").SetValue(ConvertDtToTimeZone(createdDate, timeZone));
        }
Beispiel #8
0
        public void setSelectedIdos()
        {
            ThisForm.Variables("varDebug").Value += "setSelectedIdos\n";

            //reset
            ThisForm.Variables("varSelectedIdos").Value = "";

            for (int i = 0; i < ThisForm.Components[listIdos].GetListBoxCount(); i++)
            {
                if (ThisForm.Components[listIdos].IsListBoxEntrySelected(i))
                {
                    ThisForm.Variables("varSelectedIdos").Value += ThisForm.Components[listIdos].GetListBoxText(i) + ",";
                }
            }

            //if none were selected, select all
            if (ThisForm.Variables("varSelectedIdos").Value.Equals(""))
            {
                for (int i = 0; i < ThisForm.Components[listIdos].GetListBoxCount(); i++)
                {
                    ThisForm.Variables("varSelectedIdos").Value += ThisForm.Components[listIdos].GetListBoxText(i) + ",";
                }
            }

            //remove last comma
            ThisForm.Variables("varSelectedIdos").Value = ThisForm.Variables("varSelectedIdos").Value.Substring(0, ThisForm.Variables("varSelectedIdos").Value.Length - 1);
        }
        /// <summary>
        /// when the form is in ready only mode this makes sure the cancel button reads closed. Otherwise it should read Cancel.
        /// </summary>
        public void SetCancelOrClose()
        {
            IWSFormComponent cancelCloseButton;

            if (ThisForm.Components.TryGetValue("crmCancel", out cancelCloseButton))
            {
                string caption = "Cancel";
                try
                {
                    string isReadOnly = string.Format("{0}", ThisForm.Variables("VarIsReadOnly").GetValueOfString("0"));
                    if (isReadOnly.Equals("1"))
                    {
                        caption = Application.GetStringValue("sClose");
                    }
                    else
                    {
                        caption = Application.GetStringValue("sCancel");
                    }
                }
                catch (Exception e)
                {
                    Application.DiagnosticsLog(e.ToString());
                }
                cancelCloseButton.Caption = caption;
            }
        }
        public void ModalFormReturned()
        {
            if (!ThisForm.LastModalChildEndedOk)
            {
                return;
            }

            var modalFormContext = ThisForm.ModalChildForm.Variables("VarModalContext").GetValueOfString(string.Empty).ToLower();

            switch (modalFormContext)
            {
            case "crmquickaddaccount":
                ThisForm.GenerateEvent("SetAccountIdFromModalForm");
                break;

            case "crmdialogaddress":
                SetAddress();
                ThisForm.PrimaryIDOCollection.RefreshCurrentObject();
                break;

            case "crmlookupbillto":
                SetBillTo();
                break;
            }
        }
        /// <summary>;
        /// This stores the logic for the dialog's custom submit action. It leverages IsLastAction to either move to the next grid item, or move on to the save functionality.
        /// </summary>
        public void CustomCancelAction()
        {
            if (IsLastAction())
            {
                if (ChildFormDelete() == 0)
                {
                    ChildFormSave();
                }
            }
            else
            {
                var child = ThisForm.ModalChildForm;

                if (child != null)
                {
                    var variable = child.Variables("VarID");

                    if (variable.Value != null)
                    {
                        ChildFormDelete();
                    }
                }
            }
            ThisForm.GenerateEvent("StdFormExitCancel");
        }
Beispiel #12
0
        public LoadCollectionResponseData getEventStatus(string eventName)
        {
            LoadCollectionRequestData Load = new LoadCollectionRequestData();

            Load.IDOName = "EventStates";
            Load.PropertyList.Add("EventName");
            Load.PropertyList.Add("Status");
            Load.PropertyList.Add("Originator");
            Load.PropertyList.Add("EventParmId");
            Load.Filter    = "EventName = '" + eventName + "' AND Status = '2'";
            Load.OrderBy   = "";
            Load.RecordCap = 100;
            LoadCollectionResponseData response = IDOClient.LoadCollection(Load);

            if (response.Items.Count > 0)
            {
                ThisForm.Variables("varDebug").Value += response[0, "EventName"].Value + "\n";
                ThisForm.Variables("varDebug").Value += response[0, "Status"].Value + "\n";
                ThisForm.Variables("varDebug").Value += response[0, "Originator"].Value + "\n";
                for (int i = 0; i < response.Items.Count; i++)
                {
                    ThisForm.Variables("varDebug").Value += response[i, "EventParmId"].Value + "\n";
                }
            }
            return(response);
        }
Beispiel #13
0
        public bool isEventRunning(string eventName, string ido)
        {
            LoadCollectionResponseData eventStatusResponse = getEventStatus(eventName);

            if (eventStatusResponse.Items.Count > 0)
            {
                for (int i = 0; i < eventStatusResponse.Items.Count; i++)
                {
                    LoadCollectionResponseData eventOutputParametersResponse = getEventOutputParameters(eventStatusResponse[i, "EventParmId"].Value);

                    if (eventOutputParametersResponse.Items.Count > 0)
                    {
                        ThisForm.Variables("varDebug").Value += "\nEvent running on " + eventOutputParametersResponse[0, "Value"].Value + "\n";

                        if (ido.Equals(eventOutputParametersResponse[0, "Value"].Value))
                        {
                            ThisForm.Variables("varDebug").Value += "\nEvent is already running for " + eventOutputParametersResponse[0, "Value"].Value + "\n";
                            return(true);
                        }
                    }
                }
            }
            else
            {
                ThisForm.Variables("varDebug").Value += "No " + eventName + " event is currently running for " + ido + "\n";
            }

            return(false);
        }
Beispiel #14
0
        public void importSelectedIdos1()
        {
            ThisForm.Variables("varDebug").Value += "importSelectedIdos\n\n" + ThisForm.Variables("varTableNames").Value + "\n";

            string[] selectedTableNames = ThisForm.Variables("varTableNames").Value.Split(',');
            string[] selectedIdos       = ThisForm.Variables("varSelectedIdos").Value.Split(',');

            int idosImported = 0;

            for (int i = 0; i < selectedIdos.Length; i++)
            {
                if (!isEventRunning(aesEventName, selectedIdos[i]))
                {
                    ThisForm.Variables("varTableName").Value = selectedTableNames[i];
                    ThisForm.Variables("varIdoName").Value   = selectedIdos[i];

                    if (ThisForm.Variables("varConnection").Value.Equals("ION"))
                    {
                        Application.ShowMessage("IonBatchImport");
                        //ThisForm.GenerateEvent("IonBatchImport");
                    }
                    else if (ThisForm.Variables("varConnection").Value.Equals("TOKEN"))
                    {
                        //ThisForm.GenerateEvent("tokenBatchImport");
                    }
                    else
                    {
                        Application.ShowMessage(ThisForm.Variables("varConnection").Value + " HAS TO BE EITHER ION OR TOKEN");
                    }
                    idosImported++;
                }
            }
            Application.ShowMessage(idosImported.ToString() + "/" + selectedIdos.Length.ToString() + " are now importing. Please check the 'Event Status' form to check the status of each table.");
        }
        public void RemoveSelectedAssociations()
        {
            var selectIndex = GetPropertyIndex(selectionProperty);

            if (selectIndex == -1)
            {
                var errorMessage = Application.GetStringValue("mCRMMissingProperty")
                                   .Replace("%1", ThisForm.Name)
                                   .Replace("%2", selectionProperty)
                                   .Replace("%3", string.Empty);
                Application.DiagnosticsLog(errorMessage);
                return;
            }

            var assocProperty = ThisForm.Variables("VarAssociationProperty").GetValueOfString(string.Empty);

            if (string.IsNullOrEmpty(assocProperty))
            {
                Application.ShowMessage(Application.GetStringValue("mCRMNoAssocationPropertySet"));
                return;
            }

            var rowCount = ThisForm.PrimaryIDOCollection.GetNumEntries();

            for (var i = 0; i < rowCount; i++)
            {
                var currentRowValue = ThisForm.PrimaryIDOCollection.GetObjectProperty(selectionProperty, i);
                if (currentRowValue == "1")
                {
                    ThisForm.PrimaryIDOCollection.SetCurrentObjectPropertyPlusModifyRefresh(assocProperty, null);
                }
            }
            ThisForm.PrimaryIDOCollection.Save();
            ClearAllSelection();
        }
Beispiel #16
0
        public void SurveyNavigation()
        {
            var relationalItemsPointOfReference = ThisForm.Variables("VarRelationalItemsPointOfReference").Value;

            ThisForm.PrimaryIDOCollection.SaveCurrent();
            ThisForm.Variables("VarRelationalItemsPointOfReference").SetValue(relationalItemsPointOfReference);
            ThisForm.GenerateEvent("RelatedItemsNavigation");
        }
Beispiel #17
0
        public List <string> setTableNamesFromSelectedIdo(string ido)
        {
            ThisForm.Variables("varDebug").Value += "setTableNamesFromSelectedIdo - " + ido + "\n";
            string filter = "CollectionName = '" + ido + "'";

            string sso          = ThisForm.Variables("varSSO").Value = "0";
            string serverId     = ThisForm.Variables("varServerId").Value = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("ServerID");
            string suiteContext = ThisForm.Variables("varSuiteContext").Value = "MONGOOSE/IDORequestService/ido";
            string httpMethod   = ThisForm.Variables("varHttpMethod").Value = "GET";
            string methodName   = ThisForm.Variables("varMethodName").Value = "/load/IdoTables?properties=TableName&filter=" + filter;
            string parameters   = ThisForm.Variables("varParameters").Value = "[{\"Name\":\"Accept\",\"Type\":\"header\",\"Value\":\"application/json\"}, " +
                                                                              "{\"Name\":\"X-Infor-MongooseConfig\",\"Type\":\"header\",\"Value\":\"" + ThisForm.Variables("varMongooseConfig").Value + "\"}]";
            string contentType = ThisForm.Variables("varContentType").Value = "text/plain";
            string timeout     = ThisForm.Variables("varTimeout").Value = "10000";

            InvokeRequestData IDORequest = new InvokeRequestData();

            IDORequest.IDOName    = "IONAPIMethods";
            IDORequest.MethodName = "InvokeIONAPIMethod";
            IDORequest.Parameters.Add(sso);
            IDORequest.Parameters.Add(serverId);
            IDORequest.Parameters.Add(new InvokeParameter(suiteContext));
            IDORequest.Parameters.Add(new InvokeParameter(httpMethod));
            IDORequest.Parameters.Add(new InvokeParameter(methodName));
            IDORequest.Parameters.Add(new InvokeParameter(parameters));
            IDORequest.Parameters.Add(new InvokeParameter(contentType));
            IDORequest.Parameters.Add(new InvokeParameter(timeout));
            IDORequest.Parameters.Add(IDONull.Value); //ResponseCode 8
            IDORequest.Parameters.Add(IDONull.Value); //ResponseContent 9
            IDORequest.Parameters.Add(IDONull.Value); //ResponseHeaders 10
            IDORequest.Parameters.Add(IDONull.Value); //ResponseInfobar 11

            InvokeResponseData response = IDOClient.Invoke(IDORequest);

            if (response.IsReturnValueStdError())
            {
                ThisForm.Variables("varDebug").Value += "Error: " + methodName + "\r\nResponseCode: " + response.Parameters[8].Value + "\r\nInfobar " + response.Parameters[11].Value + "\n";
            }

            //ThisForm.Variables("varDebug").Value += response.Parameters[9].Value + "\n";

            MongooseResponse mongooseResponseObj = JsonConvert.DeserializeObject <MongooseResponse>(response.Parameters[9].Value);

            if (mongooseResponseObj.Success && mongooseResponseObj.Items != null)
            {
                List <string> tables = new List <string>();
                for (int i = 0; i < mongooseResponseObj.Items.Length; i++)
                {
                    tables.Add(mongooseResponseObj.Items[i].TableName);
                }
                return(tables);
            }
            else
            {
                return(null);
            }
        }
        public void SetAddressPostCopy()
        {
            if (!string.IsNullOrEmpty(ThisForm.Variables("VarAddressID").GetValueOfString(string.Empty)))
            {
                return;
            }

            SetAddress();
        }
Beispiel #19
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);
        }
Beispiel #20
0
        /// triggered by btnAuditNext
        public void NextStep()
        {
            //changes the visible when for Submit btn
            ThisForm.Variables("VarReadyToConfirmAdjustments").Value = "1";

            ThisForm.Variables("VarAdjustmentStep").Value = "Step 2 of 2";

            SetRecordFilter();
            FilterByAdjustment();
        }
Beispiel #21
0
 public void CountChange()
 {
     if (ThisForm.Variables("VarReadyToConfirmAdjustments").Value.Equals("1"))
     {
         SetAdjustmentValue();
     }
     else
     {
         SetCountRecordFilter();
     }
 }
Beispiel #22
0
        /// triggered by btnAuditNext, unhides 3 columns and goes to step 2 which calculates adjustment for each row with count quantity
        public void NextStep()
        {
            //changes the visible when for System, Adjustment and Confirm column
            ThisForm.Variables("VarReadyToConfirmAdjustments").Value = "1";

            ThisForm.Variables("VarAuditText").Value = "Confirm Stock Lot Adjustments";
            ThisForm.Variables("VarAuditStep").Value = "Step 2 of 2";

            SetCountRecordFilter();
            FilterByCount();
        }
Beispiel #23
0
        public void EmailRelated()
        {
            var emailList        = string.Empty;
            var contactIdList    = string.Empty;
            var emailQueryFilter = "EntityID in ({0}) and IsPrimary = 1";
            var accountId        = ThisForm.PrimaryIDOCollection.CurrentItem.Properties["ID"].GetValueOfString(string.Empty);
            var acctFilter       = string.Format("AccountID='{0}'", accountId);
            var req = new LoadCollectionRequestData("CRMContact", "ID", acctFilter, "", 0);

            Application.DiagnosticsLog("EmailRelated: Load Collection contact");
            var resp      = IDOClient.LoadCollection(req);
            var mailToUrl = "mailto:";

            if (resp.Items != null && resp.Items.Count > 0)
            {
                for (int i = 0; i < resp.Items.Count; i++)
                {
                    Application.DiagnosticsLog("EmailRelated: " + resp.Items.Count.ToString());
                    var tempId = resp.Items[i].PropertyValues[0].Value;
                    // filter ID values need wrapped in single quotes to pass through load collection
                    if (!string.IsNullOrEmpty(contactIdList))
                    {
                        contactIdList += @",";
                    }
                    contactIdList += @"'" + tempId + @"'";
                }
            }
            var emailFilter = string.Format(emailQueryFilter, contactIdList);

            if (!string.IsNullOrEmpty(contactIdList))
            {
                var emailReq = new LoadCollectionRequestData("CRMEmail", "Address", emailFilter, "Address", 0);
                Application.DiagnosticsLog("EmailRelated: Load Collection email");
                var emailResp = IDOClient.LoadCollection(emailReq);

                for (int i = 0; i < emailResp.Items.Count; i++)
                {
                    var tempEmail = emailResp.Items[i].PropertyValues[0].Value;

                    if (!string.IsNullOrEmpty(emailList))
                    {
                        emailList += ";";
                    }
                    emailList += tempEmail;
                }
            }

            mailToUrl += emailList;

            ThisForm.Variables("VarMailToUrl").SetValue(mailToUrl);

            ThisForm.Components["linkEmailRelated"].SetValue(mailToUrl);
            ThisForm.Components["linkEmailRelated"].Caption = Application.GetStringValue("sEmailRelated");
        }
Beispiel #24
0
        /// <summary>
        /// Clicking the Submit button prior to selecting the Count Quantity Confirmed checkbox for each and every lot code containing Stock Adjustment amounts
        /// will pop up a dialog message indicating the "Unconfirmed" adjustments will be ignored and provide the classic Continue and Cancel action buttons.
        /// </summary>
        public void ValidateSubmit()
        {
            bool showUnconfirmedAdjustmentsPrompt = false;

            int numOfAdjustments = 0;

            ThisForm.PrimaryIDOCollection.First();
            for (int i = 0; i < ThisForm.PrimaryIDOCollection.GetNumEntries() - 1; i++)
            {
                string count             = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("CountQuantity");
                string adjustment        = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("Adjustment");
                string confirmAdjustment = ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("ConfirmAdjustment");

                Application.ShowMessage(i + "\n" + count + "\n" + adjustment + "\n" + confirmAdjustment);

                //something went wrong, adjustment did not get calculated
                if (!count.Equals("") && adjustment.Equals(""))
                {
                    Application.ShowMessage("Count " + count + " was not processed");
                }

                //if adjustment is empty, skip
                if (adjustment.Equals(""))
                {
                    ThisForm.PrimaryIDOCollection.Next();
                    continue;
                }

                //check if confirm is empty
                if (confirmAdjustment.Equals("") || confirmAdjustment.Equals("0"))
                {
                    showUnconfirmedAdjustmentsPrompt = true;
                }
                else
                {
                    Application.DiagnosticsLog("record " + i + " has a value of " + confirmAdjustment);
                }

                numOfAdjustments++;
                ThisForm.PrimaryIDOCollection.Next();
            }

            ThisForm.Variables("VarNumOfAdjustments").Value = numOfAdjustments.ToString();

            if (showUnconfirmedAdjustmentsPrompt)
            {
                ThisForm.GenerateEvent("PromptUnconfirmedAdjustments");
            }
            else
            {
                ThisForm.GenerateEvent("SubmitStockAudit");
            }
        }
 public void runActionEvent(string actionEvent)
 {
     if (!string.IsNullOrWhiteSpace(actionEvent))
     {
         Application.DiagnosticsLog(string.Format("Now attempting to generate event -- {0}.", actionEvent));
         ThisForm.GenerateEvent(actionEvent);
     }
     else
     {
         Application.DiagnosticsLog(string.Format("Action event for {0} was blank.", actionEvent));
     }
 }
 public void ClearAllSelection()
 {
     if (ThisForm.Variables("VarIsMultiSelect").Value == "1")
     {
         SetSelectStatus("0");
     }
     else
     {
         //Message for developer.
         Application.DiagnosticsLog("Multiple records selection is not allowed in" + ThisForm.Name);
     }
 }
Beispiel #27
0
        /// triggered by btnAuditPrevious, goes back to Step 1
        public void PreviousStep()
        {
            ThisForm.Variables("VarReadyToConfirmAdjustments").Value = "";

            ThisForm.Variables("VarAdjustmentStep").Value = "Step 1 of 2";

            //undo adjustment filter
            ThisForm.PrimaryIDOCollection.Filter = "";
            ThisForm.PrimaryIDOCollection.Refresh();

            SetAdjustmentValue();
        }
Beispiel #28
0
        public void CheckIfDeleteAssociation()
        {
            var variable = ThisForm.Variables("VarRelationalItemsPointOfReference").Value.Trim();

            if (variable.Contains("Reseller"))
            {
                ThisForm.Variables("VarAccountDeleteAssociation").SetValue(0);
            }
            else
            {
                ThisForm.Variables("VarAccountDeleteAssociation").SetValue(1);
            }
        }
        /// <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.");
            }
        }
Beispiel #30
0
        public void GetHeaderDetailsKPI()
        {
            var lastQuarterPipeline = ThisForm.PrimaryIDOCollection.CurrentItem.Properties["OpportunitySalesPotential"]
                                      .GetValue <decimal>();
            var totalPipeline = ThisForm.PrimaryIDOCollection.CurrentItem.Properties["TotalPipelineDer"]
                                .GetValue <decimal>();
            var revenue = ThisForm.PrimaryIDOCollection.CurrentItem.Properties["Revenue"].GetValue <decimal>();

            ThisForm.Variables("VarHeaderDetailKPIQuarterPipeline")
            .SetValue(FormatNumberForKPIDisplay(lastQuarterPipeline));
            ThisForm.Variables("VarHeaderDetailKPITotalPipeline").SetValue(FormatNumberForKPIDisplay(totalPipeline));
            ThisForm.Variables("VarHeaderDetailRevenue").SetValue(FormatNumberForKPIDisplay(revenue));
        }