Tuesday, 31 October 2017

Remove base Attribute with Customization

Hi All

In my previous article "Append and Replace of DACs Attributes" I have described how can you replace append attributed in DAC with customization.

Today I would like to add one more useful attribute - PXRemoveBaseAttribute. This one can help you to just remove one specific attribute from base field and replace it with new one if needed.

[PXUIField(DisplayName = "Test" )]
public String Field { get; set; }

Example 1:
public Extension : PXCacheExtension<DAC>
    public String Field { get; set; }

Example 2:
public Extension : PXCacheExtension<DAC>
    [PXDBDefault("New String")]
    public String Field { get; set; }

Have a nice development!

Wednesday, 18 October 2017

Rates per Day in the Report

Hi All,

Today I would like to share you my experience in building report that needs to translate currency rate on the fly.
The main challenge in this task as you may not have rates for every day. So that mean if your document is for 20th of Jan but there is no rate for that date, you need to find the latest available from list of the rates. Unfortunately this task is solvable just with standard Joins and standard DACs as we need to have little bit more tricky logic.

So to fix that I have created an SQL view that can find last available rate for the particular date.Than I have added custom DAC to Acumatica that later can be used in the Report Designer.  You can find full code of the view and the DAC in later in this article.

Here you can see join conditions
You also can use select following SQL statement where you can check how does it work.
SQL statement

Source code:

Have a nice reporting!

Monday, 16 October 2017

Move Customization project to Source Control/Another Server

Hi There,

When you are doing customization it is usually much faster and easier to start it using Acumatica Customization Browser and even create an extension library from there.
Acumatica Customization Browser
But later, you might need to move customization somewhere:
  • to source control folder 
  • to another production/testing/development server
  • to use Acumatica ERP instead of framework.
In this article I want to show you how to link all the things together if you move it.
Customization usually consists of 2 things:
  • Customization package - just a zip file that contains all the changes that should be applied during customization publication.
  • Sources of extension library - that is something that should be kept outside of customization package and require additional movement.

Monday, 9 October 2017

Difference between Acumatica ERP and Framework

Hi All,

Previously I had quite a lot of questions about how to integrate development done on Acumatica Framework with Acumatica ERP.
Usually them main reason of that question is misunderstanding of what is Acumatica Framework.

Acumatica Framework (what you can download as separate installer from portal) is designed to develop product that is completely separated from Acumatica ERP. That is why there are less functions and no code integration with ERP.
 Acumatica Framework 6.1

In case you are see benefits of using functions form Acumatica ERP (like segmented keys, numbering, accounts, subaccounts, customers/vendors, inventory items), it would be much better to start development on Acumatica ERP itself from the beginning, and do not use Acumatica Framework at all.
 Acumatica Framework 6.1
T300 - Acumatica Customization Platform training guide exactly explains you how to create new functionality with close connection to ERP and even how to use Visual Studio without installing Framework.

Difference between ERP and Framework
The main misunderstanding I faced before here is that based on the name you may expect that Framework should be installed prior to ERP (like .NET Framework), but that is not correct.
When you install Acumatica ERP, framework is already included there and does not require separate installations.
If to dig little bit in the details, Acumatica Framework consists on multiple system libraries: PX.Common.dll, PX.Data.dll, PX.Web.UI.dll, set of system screens as aspx file and so on. Comparing to that almost whole Acumatica ERP is included into one PX.Objects.dll and set of screens as aspx files.

So if to simplify it little bit - ERP contains all possible dlls, but Framework missing some of them with business logic. Other things are absolutely the same.
Based on description above you can understand that you can develop absolutely the same way on Acumatica ERP as you do in on Acumatica Framework. And even more ERP gives you much more benefits as it has a lot of nice business logic that you can reuse and save cost on development.

There still is one real difference of Framework comparing to ERP - Framework has function to deploy templates of forms that you can create from Visual Studio.
However that is not really needed as you can use Acumatica Customization Tools to generate forms and DACs. You can read more about it here and here.

That misunderstanding comes to T100 and T200 training guides where you learning how to develop new functionality using Framework. Later you think that it is the proper way of doing new development.
However it just shows you that you can use Acumatica Framework without ERP at all and does not limit you on such ways. In T300 training guide you also learn how you can use ERP directly do so same development including programming in Visual Studio.

As I know later Automatic's team will update training guides to new flow, so it should eliminate that misunderstanding, and it all will be fine.

Have a nice development!

Tuesday, 3 October 2017

DACs Inheritance and Caches

Hi All

Want to speak today about DACs inheritance in Acumatica and some issues that it cause to development.
DACs inheritance in Acumatica

As you know C#/.NET as OOP-oriented framework support inheritance of objects, but when in comes SQL and Database structure than there is no inheritance between tables.
DACs inheritance in Acumatica
As a bonus I will explain why we need BAccount and BAccount2 DACs and what is the difference.