Skip to main content
Question

While publishing multiple tenant Getting error PX.Data.PXUndefinedCompanyException


While publishing customization on multiple tenant getting below error, in acumatica 24R1(version 24.100.139)

Error:- PX.Data.PXUndefinedCompanyException: A proper company ID cannot be determined for the request.

If I have published single tenant then its published successfully. we are creating numbering sequence and Provide permission to Roles on master data plugin

Please find code that I have written in Master data plugin and I am executing below method from UpdateDatabase method of master data plugin.

Its working fine on acumatica 23R2 version.

 

 

GenerateNumberingData Method for generating numbering sequence for my customization screen

 

Code:-

 

 NumberingMaint graph = PXGraph.CreateInstance<NumberingMaint>();
        //string file = Path.Combine(rootFilePath, EWPMConstant.NumberingCSVFileName);
        //List<EWPMNumberingDTO> numberingList = EWPMCSVHelper.ImportCSV<EWPMNumberingDTO>(file, null);
        List<EWPMNumberingDTO> numberingList = EWPMMasterDataHelper.GetPMNumberingMasterData();


        foreach(EWPMNumberingDTO numberingDTO in numberingList) {
            //Check If Record is already exist
            Numbering existingNumbering = graph.Numbering.Search<Numbering.numberingID>(numberingDTO.NumberingID);

            #region Numbering Master Data

            if(existingNumbering != null) {
                WriteLog(string.Format("{0} already exists - skipped.", numberingDTO.NumberingID));
            }
            else {
                Numbering numbering = new Numbering();
                numbering.NumberingID = numberingDTO.NumberingID;
                numbering.NewSymbol = numberingDTO.NewSymbol;
                numbering.UserNumbering = numberingDTO.UserNumbering;
                numbering.Descr = numberingDTO.Descr;
                PXContext.SetScreenID("SM209900");
                graph.Numbering.Insert(numbering);

                #region Numbering Sequence Master Data                    

                string roleDataFiltPath = Path.Combine(rootFilePath, EWPMConstant.NumberingSequenceCSVFileName);
                EWPMNumberingHelper.AddNumberingSequence(graph, roleDataFiltPath, numberingDTO.NumberingID);

                #endregion

                graph.Save.Press();

                WriteLog(string.Format("{0} and it's record was succesfully created.", numberingDTO.NumberingID));

            }

            #endregion
        }

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings