Solved

Importing customization project to Acumatica projects


Userlevel 4
Badge +2

Hi, 

I have 3 custom projects in my Acumatica that I need to reuse in other Acumatica instances with same version 2021r2

In this topic : 

It was described how to merge 3 customization projects into one single.

My goal is to merge all customization projects into one single and use new package for other Acumatica instances with same version 2021R2

In this topic 

It was described how to merge customization projects into one single.

So, I had separated packages before

With the new package that contains  package “Custom Endpoint” I receive such error while publishing my new customization package that contains “Custom Endpoint” package 

I tried to change namespace CustomEndpoint for which I receive error,  to my project name namespace, but it become unworkable, so I cancelled changes.

Just to be sure that I described everything :

  1. I merged customization project into one 

    by viewing published 

    1. I tried to publish it to another Acumatica instance but get error for your customization package

Please, help to solve this

icon

Best answer by markusray17 1 August 2022, 23:01

View original

12 replies

Userlevel 6
Badge +5

If it is working on the original site but not when you try to publish it on another site you likely need to update the files in the customization project before exporting the customization project.

 

When you build a project in visual studio it will place the .dll files in the instance Bin folder but it does not automatically update the customization project. 

Userlevel 4
Badge +2

If it is working on the original site but not when you try to publish it on another site you likely need to update the files in the customization project before exporting the customization project.

 

When you build a project in visual studio it will place the .dll files in the instance Bin folder but it does not automatically update the customization project. 

Hi @markusray17 

Acumatica shows that nothing detected for this custom project 

 

Userlevel 6
Badge +5

In your screenshot there aren’t any .dll files, did you forget to add them to the project or is all your code within the code customization section?

I would double check that your customization isn’t relying on any assemblies(.dll files) that aren’t included in the project.

Without seeing the code though it’s hard to say what exactly is causing the issue. Generally I have seen this issue pop up when you are using/referencing something that is defined in an assembly that is not included in the customization project but was in the Bin folder of the original instance. 

Userlevel 4
Badge +2

In your screenshot there aren’t any .dll files, did you forget to add them to the project or is all your code within the code customization section?

I would double check that your customization isn’t relying on any assemblies(.dll files) that aren’t included in the project.

Without seeing the code though it’s hard to say what exactly is causing the issue. Generally I have seen this issue pop up when you are using/referencing something that is defined in an assembly that is not included in the customization project but was in the Bin folder of the original instance. 

This customization project does not contain additional dll’s

It was prepared for string credentials

I attach the code 

    public class StoreCredentials : PXGraph<StoreCredentials>
    {
        #region Views
        public PXFilter<Filter> Filter;

        //  add View for the custom table here
        //    public PXSelect<Customtable> InsertRecords;
        DataBaseLogic dataBaseLogic = new DataBaseLogic();
        #endregion

        public PXAction<Filter> InsertCredentials;
        [PXButton]
        [PXUIField(DisplayName = "Insert Credentials")]
        public void insertCredentials()
        {

            try
            {
                Filter filter = Filter.Current;
                if (filter != null && filter.UserName != null && filter.Password != null && filter.usrURL != null)
                {
                    InsertDetails(filter);
                }
            }
            catch (Exception ex)
            {
                PXTrace.Logger.Error(ex.Message + "\n" + ex.InnerException);
            }

        }

        public void InsertDetails(Filter filter)
        {
            Encryptor encryptor = new Encryptor();
            dataBaseLogic.SaveToDataBase(filter.UserName, encryptor.CodePassword(filter.Password), filter.usrURL);
            Actions.PressSave();
        }
    }


    public class Filter : IBqlTable
    {
        public virtual void DAC_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            PXDBCryptStringAttribute.SetDecrypted<Filter.password>(sender, e.Row, true);
        }

        #region UserName
        [PXString(30, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "UserName")]
        public virtual string UserName { get; set; }
        public abstract class userName : BqlString.Field<userName> { }
        #endregion

        #region URL
        [PXString(30, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "URL")]
        public virtual string usrURL { get; set; }
        public abstract class uRL : BqlString.Field<uRL> { }
        #endregion

These are all namespaces that are used 

 

Userlevel 6
Badge +5

Are you able to share the merged customization zip?

There error isn’t with the namespace the system is saying it can’t find the StoreCredentials class nor the Filter class. 

Userlevel 4
Badge +2

Are you able to share the merged customization zip?

There error isn’t with the namespace the system is saying it can’t find the StoreCredentials class nor the Filter class. 

@markusray17 

Attached the package 

Userlevel 6
Badge +5

The StoreCredentials code object is basically empty which is probably why you are getting the error. The code you posted above is not the code you are publishing.

 

 

 

Userlevel 4
Badge +2

The StoreCredentials code object is basically empty which is probably why you are getting the error. The code you posted above is not the code you are publishing.

 

 

 

It is strange that it works on one Acumatica instance, but on the other it is revealed that code is defined in a wrong place

How to fix it ?

In Acumatica customization project this class is empty 

However this logic that I wrote in my project is fully workable

 

Userlevel 6
Badge +5

Your screenshot appears to be visual studio. As I mentioned earlier if you created that using the “Create Extension Library” it will automatically put the .dll file into the Bin folder of the current Acumatica instance when you build the visual studio project.

You would need to manually add those .dll files to the customization project. Alternatively you probably could just copy paste the code from visual studio into the Code object in the Customization editor. It is only working on the original instance because the .dll files were already in the Bin folder.

 

Userlevel 4
Badge +2

Your screenshot appears to be visual studio. As I mentioned earlier if you created that using the “Create Extension Library” it will automatically put the .dll file into the Bin folder of the current Acumatica instance when you build the visual studio project.

You would need to manually add those .dll files to the customization project. Alternatively you probably could just copy paste the code from visual studio into the Code object in the Customization editor. It is only working on the original instance because the .dll files were already in the Bin folder.

 

@markusray17 

Thanks for explanation

Which approach is  better to add .dll files to the customization project or copy paste the code from visual studio into the Code object in the Customization editor ?

If to do it via adding dll’s this must be done at this tab ?

 

Userlevel 6
Badge +5

Yes you add them under the Files section from the Bin folder. By default they will have the same name as the project.

 

As for which is better it depends on the project, personally I almost always go the extension library route unless it is something extremely simple because managing any substantial amount of code via the Customization project editor is a bit of a pain.

Userlevel 4
Badge +2

Yes you add them under the Files section from the Bin folder. By default they will have the same name as the project.

 

As for which is better it depends on the project, personally I almost always go the extension library route unless it is something extremely simple because managing any substantial amount of code via the Customization project editor is a bit of a pain.

@markusray17 

Thank you for your assistance

My issue is resolved 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved