protected virtual IEnumerable createMessage(PXAdapter adapter)
        {
            SlackMessageMaint graph = PXGraph.CreateInstance <SlackMessageMaint>();
            SlackMessage      msg   = WebRequest.createTestSlackMessage();

            graph.Messages.Insert(msg);
            graph.Save.Press();
            return(adapter.Get());
        }
        public static void Process(List <SlackMessage> list, bool isMassProcess)
        {
            string            errorMessage  = string.Empty;
            bool              erroroccurred = false;
            SlackSetupMaint   setupGraph    = PXGraph.CreateInstance <SlackSetupMaint>();
            SlackMessageMaint graph         = PXGraph.CreateInstance <SlackMessageMaint>();
            SlackSetup        setup         = setupGraph.SetupRecord.SelectSingle();

            foreach (SlackMessage message in list)
            {
                try
                {
                    if ((bool)message.IsSimple)
                    {
                        var msg = createSimpleMessage(message);
                        WebRequest.postRequest(setup.SlackURL, msg);
                    }
                    else
                    {
                        //var  msg = createDetailMessage(message);
                        var msg = createDetailMessageWithFields(setup.AcumaticaURL, message);
                        WebRequest.postRequest(setup.SlackURL, msg);
                    }
                    message.Released = true;
                    graph.Messages.Update(message);
                    graph.Save.Press();
                    PXProcessing <SlackMessage> .SetInfo(list.IndexOf(message), "Processed.");
                }
                catch (Exception ex)
                {
                    errorMessage  = ex.Message;
                    erroroccurred = true;
                    PXProcessing <SlackMessage> .SetError(list.IndexOf(message), String.Format("{0}", ex.Message));
                }
            }
            if (erroroccurred && isMassProcess)
            {
                throw new PXException("A least one Transaction hasn't been processed.");
            }
            if (erroroccurred && !isMassProcess)
            {
                throw new PXException(errorMessage);
            }
        }