Skip to main content
Solved

Importing customization project to Acumatica projects


Forum|alt.badge.img+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 : 

https://community.acumatica.com/integrations-and-isv-solutions-116/move-changes-from-customization-project-to-new-10431

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 

https://community.acumatica.com/integrations-and-isv-solutions-116/move-changes-from-customization-project-to-new-10431

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

Best answer by markusray17

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.

 

View original

Forum|alt.badge.img+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. 


Forum|alt.badge.img+2
  • Varsity I
  • August 1, 2022
markusray17 wrote:

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 

 


Forum|alt.badge.img+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. 


Forum|alt.badge.img+2
  • Varsity I
  • August 1, 2022
markusray17 wrote:

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 

 


Forum|alt.badge.img+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. 


Forum|alt.badge.img+2
  • Varsity I
  • August 1, 2022
markusray17 wrote:

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 


Forum|alt.badge.img+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.

 

 

 


Forum|alt.badge.img+2
  • Varsity I
  • August 1, 2022
markusray17 wrote:

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

 


Forum|alt.badge.img+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.

 


Forum|alt.badge.img+2
  • Varsity I
  • August 2, 2022
markusray17 wrote:

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 ?

 


Forum|alt.badge.img+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.


Forum|alt.badge.img+2
  • Varsity I
  • August 3, 2022
markusray17 wrote:

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


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